{"record":{"id":"8c0bfaa52df50939","repo":"Comfy-Org/ComfyUI","slug":"one-of-prompt-or-structured-prompt-is-required-to","errorCode":null,"errorMessage":"One of prompt or structured_prompt is required to be non-empty.","messagePattern":"One of prompt or structured_prompt is required to be non-empty\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bria.py","lineNumber":158,"sourceCode":"            ),\n        )\n\n    @classmethod\n    async def execute(\n        cls,\n        model: str,\n        image: Input.Image,\n        prompt: str,\n        negative_prompt: str,\n        structured_prompt: str,\n        seed: int,\n        guidance_scale: float,\n        steps: int,\n        moderation: InputModerationSettings,\n        mask: Input.Image | None = None,\n    ) -> IO.NodeOutput:\n        if not prompt and not structured_prompt:\n            raise ValueError(\"One of prompt or structured_prompt is required to be non-empty.\")\n        mask_url = None\n        if mask is not None:\n            mask_url = await upload_image_to_comfyapi(cls, convert_mask_to_image(mask), wait_label=\"Uploading mask\")\n        response = await sync_op(\n            cls,\n            ApiEndpoint(path=\"proxy/bria/v2/image/edit\", method=\"POST\"),\n            data=BriaEditImageRequest(\n                instruction=prompt if prompt else None,\n                structured_instruction=structured_prompt if structured_prompt else None,\n                images=[await upload_image_to_comfyapi(cls, image, wait_label=\"Uploading image\")],\n                mask=mask_url,\n                negative_prompt=negative_prompt if negative_prompt else None,\n                guidance_scale=guidance_scale,\n                seed=seed,\n                model_version=model,\n                steps_num=steps,\n                prompt_content_moderation=moderation.get(\"prompt_content_moderation\", False),\n                visual_input_content_moderation=moderation.get(\"visual_input_moderation\", False),","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bria.py#L140-L176","documentation":"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.","triggerScenarios":"Calling BriaEditImage.execute with prompt == '' and structured_prompt == '' (both widgets blank).","commonSituations":"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.","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."],"exampleFix":"// before\nprompt = ''\nstructured_prompt = ''\n// after\nprompt = 'remove the background and add a beach'","handlingStrategy":"validation","validationCode":"if not prompt.strip() and not structured_prompt.strip():\n    raise UserError('Fill prompt or structured_prompt before running Bria edit.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make prompt a required mental checklist item for any Bria edit node.","When templating prompts, assert the rendered string is non-empty before queueing."],"tags":["comfyui","bria","validation","prompt-required","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}