{"record":{"id":"6b66a213830d8896","repo":"Comfy-Org/ComfyUI","slug":"luma-generation-failed-msg","errorCode":null,"errorMessage":"Luma generation failed: {msg}","messagePattern":"Luma generation failed: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_luma.py","lineNumber":726,"sourceCode":"        ApiEndpoint(path=\"/proxy/luma_2/generations\", method=\"POST\"),\n        response_model=Luma2Generation,\n        data=request,\n    )\n    if not initial.id:\n        raise RuntimeError(\"Luma API did not return a generation id.\")\n    final = await poll_op(\n        cls,\n        ApiEndpoint(path=f\"/proxy/luma_2/generations/{initial.id}\", method=\"GET\"),\n        response_model=Luma2Generation,\n        status_extractor=lambda r: r.state,\n        progress_extractor=lambda r: None,\n        estimated_duration=estimated_duration,\n    )\n    if not final.output or not final.output[0].url:\n        msg = final.failure_reason or \"no output returned\"\n        if final.failure_code:\n            msg = f\"{msg} [{final.failure_code}]\"\n        raise RuntimeError(f\"Luma generation failed: {msg}\")\n    return final\n\n\nclass LumaImageNode(IO.ComfyNode):\n\n    @classmethod\n    def define_schema(cls) -> IO.Schema:\n        return IO.Schema(\n            node_id=\"LumaImageNode2\",\n            display_name=\"Luma UNI-1 Image\",\n            category=\"partner/image/Luma\",\n            description=\"Generate images from text using the Luma UNI-1 model.\",\n            inputs=[\n                IO.String.Input(\n                    \"prompt\",\n                    multiline=True,\n                    default=\"\",\n                    tooltip=\"Text description of the desired image. 1–6000 characters.\",","sourceCodeStart":708,"sourceCodeEnd":744,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_luma.py#L708-L744","documentation":"Raised by _luma2_submit_and_poll (comfy_api_nodes/nodes_luma.py:726) after polling completes when the final generation has no output URL. The message includes failure_reason (or 'no output returned') and the failure_code when the API supplies one, so the text reflects the remote failure cause, not local state.","triggerScenarios":"Any Luma 2 / Ray 3.2 generation that terminates in a failed/canceled state: content-policy rejection, upstream model error, provider capacity issues, or a job that ends with empty output.","commonSituations":"Prompts flagged by moderation;高峰 provider load; ambiguous requests the model fails to complete; videos with reference images that violate upstream policies.","solutions":["Read failure_reason/failure_code in the message and address it (rephrase flagged prompts, swap reference media).","Retry with a new seed — some failures are stochastic per job.","Retry after a short wait if the reason suggests provider load/capacity.","If it fails deterministically, simplify the request (drop refs, change duration/resolution) to isolate the trigger."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    gen = await _luma2_submit_and_poll(cls, request)\nexcept RuntimeError as e:\n    # message carries failure_reason [failure_code] from the API\n    if \"content\" in str(e).lower():\n        raise  # deterministic policy failure — fix the prompt/refs\n    await asyncio.sleep(5)  # capacity-style failure: retry once\n    gen = await _luma2_submit_and_poll(cls, request)","preventionTips":["Surface failure_reason/failure_code to the end user verbatim — it names the upstream cause.","Change the seed on retry; many generation failures are per-job stochastic.","Avoid prompts/reference media likely to trip moderation when targeting Luma."],"tags":["luma","generation-failed","api-error","polling","comfy-api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}