Comfy-Org/ComfyUI · error · ValueError
One of prompt or structured_prompt is required to be non-emp
Error message
One of prompt or structured_prompt is required to be non-empty.
What it means
Bria's image edit endpoint requires editing instructions: the node sends instruction (prompt) or structured_instruction (structured_prompt) and refuses to call the API when both are empty strings, since Bria would have nothing to act on.
Source
Thrown at comfy_api_nodes/nodes_bria.py:158
),
)
@classmethod
async def execute(
cls,
model: str,
image: Input.Image,
prompt: str,
negative_prompt: str,
structured_prompt: str,
seed: int,
guidance_scale: float,
steps: int,
moderation: InputModerationSettings,
mask: Input.Image | None = None,
) -> IO.NodeOutput:
if not prompt and not structured_prompt:
raise ValueError("One of prompt or structured_prompt is required to be non-empty.")
mask_url = None
if mask is not None:
mask_url = await upload_image_to_comfyapi(cls, convert_mask_to_image(mask), wait_label="Uploading mask")
response = await sync_op(
cls,
ApiEndpoint(path="proxy/bria/v2/image/edit", method="POST"),
data=BriaEditImageRequest(
instruction=prompt if prompt else None,
structured_instruction=structured_prompt if structured_prompt else None,
images=[await upload_image_to_comfyapi(cls, image, wait_label="Uploading image")],
mask=mask_url,
negative_prompt=negative_prompt if negative_prompt else None,
guidance_scale=guidance_scale,
seed=seed,
model_version=model,
steps_num=steps,
prompt_content_moderation=moderation.get("prompt_content_moderation", False),
visual_input_content_moderation=moderation.get("visual_input_moderation", False),View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Type a non-empty prompt describing the edit.
- Or fill structured_prompt (Bria's structured instruction format) if you prefer machine-readable instructions.
- If driving the node programmatically, assert at least one of the two strings is truthy before queueing the prompt.
Example fix
// before prompt = '' structured_prompt = '' // after prompt = 'remove the background and add a beach'
Defensive patterns
Strategy: validation
Validate before calling
if not prompt.strip() and not structured_prompt.strip():
raise UserError('Fill prompt or structured_prompt before running Bria edit.') Prevention
- Make prompt a required mental checklist item for any Bria edit node.
- When templating prompts, assert the rendered string is non-empty before queueing.
When it happens
Trigger: Calling BriaEditImage.execute with prompt == '' and structured_prompt == '' (both widgets blank).
Common situations: User relies on the input image alone and leaves prompt empty; prompt text was in a variable that evaluated to empty/whitespace-only; frontend widget defaulted to empty string.
Related errors
- Connect at least one keyframe image.
- Spreading {len(images)} images across the clip needs an expl
- The mask is empty, so there is nothing to {action}. Masks ar
- Mask must have the same aspect ratio as the image: image is
- Bria accepts a width-to-height ratio between {BRIA_MIN_RATIO
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/8c0bfaa52df50939.
Report an issue: GitHub.