Comfy-Org/ComfyUI · error · RuntimeError
Luma API did not return a generation id.
Error message
Luma API did not return a generation id.
What it means
Raised by _luma2_submit_and_poll (comfy_api_nodes/nodes_luma.py:713) when a POST to /proxy/luma_2/generations returns 2xx but the response model has no id. Without an id the node cannot poll the generation, so it aborts immediately. This indicates a malformed/unexpected response from the Luma proxy rather than bad user input.
Source
Thrown at comfy_api_nodes/nodes_luma.py:713
raise ValueError(f"Maximum {max_count} reference images are allowed.")
return out or None
async def _luma2_submit_and_poll(
cls: type[IO.ComfyNode],
request: Luma2GenerationRequest,
*,
estimated_duration: int | None = None,
) -> Luma2Generation:
"""Submit a Luma Agents generation and poll until done; returns the completed generation."""
initial = await sync_op(
cls,
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):
View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Re-run the node once — transient malformed responses usually resolve.
- Check the raw proxy response (enable API request logging) to confirm what body came back.
- If persistent, update ComfyUI/comfy_api_nodes — the response model may need to track an upstream API change.
- Report the response shape to the repo maintainers if it persists on the latest version.
Defensive patterns
Strategy: retry
Try / catch
for attempt in range(2):
try:
return await _luma2_submit_and_poll(cls, request)
except RuntimeError as e:
if "did not return a generation id" in str(e) and attempt == 0:
continue # malformed proxy response; one retry is cheap
raise Prevention
- Treat missing-id responses as transient first; only investigate after a retry reproduces it.
- Keep comfy_api_nodes updated so the Luma2Generation response model tracks upstream schema changes.
- Enable API response logging before reporting the issue so the raw body is captured.
When it happens
Trigger: The Luma 2 proxy accepts the generation request but returns a body missing the id field (API schema change, proxy error payload parsed into Luma2Generation, or an empty/malformed success response).
Common situations: Luma backend schema drift; a middleware/proxy returning an error envelope with 200; transient backend issues right after outages or version changes.
Related errors
- source_generation_id is required (connect the generation_id
- At least one of first_image and last_image requires an input
- Maximum {max_count} reference images are allowed.
- Luma generation failed: {msg}
- 'manga' style requires a portrait aspect ratio ({allowed_man
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/85fe8a1fedafc837.
Report an issue: GitHub.