Comfy-Org/ComfyUI · error · ValueError
Ray 3.2 supports at most 64 keyframes; got {len(items)}.
Error message
Ray 3.2 supports at most 64 keyframes; got {len(items)}. What it means
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).
Source
Thrown at comfy_api_nodes/nodes_luma.py:1240
@classmethod
async def execute(
cls,
prompt: str,
resolution: str,
duration: str,
seed: int,
keyframes: LumaRay32KeyframeChain | None = None,
) -> IO.NodeOutput:
validate_string(prompt, strip_whitespace=True, min_length=1, max_length=6000)
items = keyframes.items if keyframes is not None else []
if len(items) < 2:
raise ValueError(
"Connect at least 2 Luma Ray 3.2 Keyframe nodes "
"(use Luma Ray 3.2 Image to Video for a single start/end frame)."
)
if len(items) > 64:
raise ValueError(f"Ray 3.2 supports at most 64 keyframes; got {len(items)}.")
maxframe = 120 if duration == "5s" else 240
duration_seconds = maxframe / 24 # 5.0 or 10.0
# Resolve each keyframe to an output-frame index, then order by position
# (so the user can chain keyframes in any order — the position is what places them)
placed: list[tuple[int, torch.Tensor]] = []
for item in items:
if item.mode == LUMA_KEYFRAME_MODE_SECONDS:
if item.value > duration_seconds:
raise ValueError(
f"Keyframe position {item.value:g}s is past the end of the {duration} video; "
f"use 0-{duration_seconds:g}s (or switch the keyframe to fraction mode)."
)
idx = round(item.value * 24)
else:
idx = round(item.value * maxframe)
placed.append((max(0, min(maxframe, idx)), item.image))
placed.sort(key=lambda p: p[0])
indexes = [idx for idx, _ in placed]View on GitHub (pinned to 1c6d8d45b3)
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.
Defensive patterns
Strategy: validation
Validate before calling
if len(items) > 64:
raise ValueError(f"Trim keyframes to <= 64 (got {len(items)})") Prevention
- Cap programmatically generated keyframe chains at 64.
- Consolidate keyframes closer than one frame apart (1/24s) — they add nothing.
When it happens
Trigger: Connecting 65+ LumaRay32KeyframeNode outputs into the keyframe chain input of the keyframe video node.
Common situations: Programmatically generated workflows or scripts auto-inserting a keyframe per scene cut; users assuming one keyframe per second requires many entries.
Related errors
- Connect at least 2 Luma Ray 3.2 Keyframe nodes (use Luma Ray
- Keyframe position {item.value:g}s is past the end of the {du
- Two keyframes resolve to the same output frame ({a}) for a {
- At least one of first_image and last_image requires an input
- Looping is only available with 5s duration on Ray 3.2.
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/f8c59ed595f3ffd6.
Report an issue: GitHub.