{"record":{"id":"f8c59ed595f3ffd6","repo":"Comfy-Org/ComfyUI","slug":"ray-3-2-supports-at-most-64-keyframes-got-len-it","errorCode":null,"errorMessage":"Ray 3.2 supports at most 64 keyframes; got {len(items)}.","messagePattern":"Ray 3\\.2 supports at most 64 keyframes; got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_luma.py","lineNumber":1240,"sourceCode":"\n    @classmethod\n    async def execute(\n        cls,\n        prompt: str,\n        resolution: str,\n        duration: str,\n        seed: int,\n        keyframes: LumaRay32KeyframeChain | None = None,\n    ) -> IO.NodeOutput:\n        validate_string(prompt, strip_whitespace=True, min_length=1, max_length=6000)\n        items = keyframes.items if keyframes is not None else []\n        if len(items) < 2:\n            raise ValueError(\n                \"Connect at least 2 Luma Ray 3.2 Keyframe nodes \"\n                \"(use Luma Ray 3.2 Image to Video for a single start/end frame).\"\n            )\n        if len(items) > 64:\n            raise ValueError(f\"Ray 3.2 supports at most 64 keyframes; got {len(items)}.\")\n        maxframe = 120 if duration == \"5s\" else 240\n        duration_seconds = maxframe / 24  # 5.0 or 10.0\n        # Resolve each keyframe to an output-frame index, then order by position\n        # (so the user can chain keyframes in any order — the position is what places them)\n        placed: list[tuple[int, torch.Tensor]] = []\n        for item in items:\n            if item.mode == LUMA_KEYFRAME_MODE_SECONDS:\n                if item.value > duration_seconds:\n                    raise ValueError(\n                        f\"Keyframe position {item.value:g}s is past the end of the {duration} video; \"\n                        f\"use 0-{duration_seconds:g}s (or switch the keyframe to fraction mode).\"\n                    )\n                idx = round(item.value * 24)\n            else:\n                idx = round(item.value * maxframe)\n            placed.append((max(0, min(maxframe, idx)), item.image))\n        placed.sort(key=lambda p: p[0])\n        indexes = [idx for idx, _ in placed]","sourceCodeStart":1222,"sourceCodeEnd":1258,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_luma.py#L1222-L1258","documentation":"Raised by the Luma Ray 3.2 keyframe video node (comfy_api_nodes/nodes_luma.py:1240) when more than 64 keyframe nodes are chained. 64 is the upstream Ray 3.2 limit on keyframes per generation (a 10s/240-frame video can otherwise over-specify positions).","triggerScenarios":"Connecting 65+ LumaRay32KeyframeNode outputs into the keyframe chain input of the keyframe video node.","commonSituations":"Programmatically generated workflows or scripts auto-inserting a keyframe per scene cut; users assuming one keyframe per second requires many entries.","solutions":["Reduce the chain to at most 64 keyframe nodes.","Consolidate nearby keyframes — positions that round to adjacent frames rarely add value.","If scripting workflow generation, cap the emitted keyframe count at 64."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(items) > 64:\n    raise ValueError(f\"Trim keyframes to <= 64 (got {len(items)})\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap programmatically generated keyframe chains at 64.","Consolidate keyframes closer than one frame apart (1/24s) — they add nothing."],"tags":["luma","ray-3-2","keyframes","limit","input-validation","comfy-api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}