{"record":{"id":"85fe8a1fedafc837","repo":"Comfy-Org/ComfyUI","slug":"luma-api-did-not-return-a-generation-id","errorCode":null,"errorMessage":"Luma API did not return a generation id.","messagePattern":"Luma API did not return a generation id\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_luma.py","lineNumber":713,"sourceCode":"        raise ValueError(f\"Maximum {max_count} reference images are allowed.\")\n    return out or None\n\n\nasync def _luma2_submit_and_poll(\n    cls: type[IO.ComfyNode],\n    request: Luma2GenerationRequest,\n    *,\n    estimated_duration: int | None = None,\n) -> Luma2Generation:\n    \"\"\"Submit a Luma Agents generation and poll until done; returns the completed generation.\"\"\"\n    initial = await sync_op(\n        cls,\n        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","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_luma.py#L695-L731","documentation":"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.","triggerScenarios":"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).","commonSituations":"Luma backend schema drift; a middleware/proxy returning an error envelope with 200; transient backend issues right after outages or version changes.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in range(2):\n    try:\n        return await _luma2_submit_and_poll(cls, request)\n    except RuntimeError as e:\n        if \"did not return a generation id\" in str(e) and attempt == 0:\n            continue  # malformed proxy response; one retry is cheap\n        raise","preventionTips":["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."],"tags":["luma","api-contract","generation-id","runtime","comfy-api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}