Comfy-Org/ComfyUI · error · RuntimeError

Luma generation failed: {msg}

Error message

Luma generation failed: {msg}

What it means

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.

Source

Thrown at comfy_api_nodes/nodes_luma.py:726

        ApiEndpoint(path="/proxy/luma_2/generations", method="POST"),
        response_model=Luma2Generation,
        data=request,
    )
    if not initial.id:
        raise RuntimeError("Luma API did not return a generation id.")
    final = await poll_op(
        cls,
        ApiEndpoint(path=f"/proxy/luma_2/generations/{initial.id}", method="GET"),
        response_model=Luma2Generation,
        status_extractor=lambda r: r.state,
        progress_extractor=lambda r: None,
        estimated_duration=estimated_duration,
    )
    if not final.output or not final.output[0].url:
        msg = final.failure_reason or "no output returned"
        if final.failure_code:
            msg = f"{msg} [{final.failure_code}]"
        raise RuntimeError(f"Luma generation failed: {msg}")
    return final


class LumaImageNode(IO.ComfyNode):

    @classmethod
    def define_schema(cls) -> IO.Schema:
        return IO.Schema(
            node_id="LumaImageNode2",
            display_name="Luma UNI-1 Image",
            category="partner/image/Luma",
            description="Generate images from text using the Luma UNI-1 model.",
            inputs=[
                IO.String.Input(
                    "prompt",
                    multiline=True,
                    default="",
                    tooltip="Text description of the desired image. 1–6000 characters.",

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Read failure_reason/failure_code in the message and address it (rephrase flagged prompts, swap reference media).
  2. Retry with a new seed — some failures are stochastic per job.
  3. Retry after a short wait if the reason suggests provider load/capacity.
  4. If it fails deterministically, simplify the request (drop refs, change duration/resolution) to isolate the trigger.
Defensive patterns

Strategy: retry

Try / catch

try:
    gen = await _luma2_submit_and_poll(cls, request)
except RuntimeError as e:
    # message carries failure_reason [failure_code] from the API
    if "content" in str(e).lower():
        raise  # deterministic policy failure — fix the prompt/refs
    await asyncio.sleep(5)  # capacity-style failure: retry once
    gen = await _luma2_submit_and_poll(cls, request)

Prevention

When it happens

Trigger: 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.

Common situations: Prompts flagged by moderation;高峰 provider load; ambiguous requests the model fails to complete; videos with reference images that violate upstream policies.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/6b66a213830d8896. Report an issue: GitHub.