Comfy-Org/ComfyUI · error · ValueError
The 'end_frame' input cannot be used simultaneously with 're
Error message
The 'end_frame' input cannot be used simultaneously with 'reference_images'.
What it means
Raised by OmniProFirstLastFrameNode.execute when both end_frame and reference_images are connected. The Kling omni API treats end_frame as a special typed image entry and reference_images as generic reference entries; sending both in one request is not a supported combination, so the node rejects it before uploading anything.
Source
Thrown at comfy_api_nodes/nodes_kling.py:880
storyboards: dict | None = None,
generate_audio: bool = False,
seed: int = 0,
) -> IO.NodeOutput:
_ = seed
if model_name == "kling-video-o1":
if duration > 10:
raise ValueError("kling-video-o1 does not support durations greater than 10 seconds.")
if generate_audio:
raise ValueError("kling-video-o1 does not support audio generation.")
if resolution == "4k":
raise ValueError("kling-video-o1 does not support 4k resolution.")
stories_enabled = storyboards is not None and storyboards["storyboards"] != "disabled"
if stories_enabled and model_name == "kling-video-o1":
raise ValueError("kling-video-o1 does not support storyboards.")
prompt = normalize_omni_prompt_references(prompt)
validate_string(prompt, strip_whitespace=True, min_length=0 if stories_enabled else 1, max_length=2500)
if end_frame is not None and reference_images is not None:
raise ValueError("The 'end_frame' input cannot be used simultaneously with 'reference_images'.")
if end_frame is not None and stories_enabled:
raise ValueError("The 'end_frame' input cannot be used simultaneously with storyboards.")
if (
model_name == "kling-video-o1"
and duration not in (5, 10)
and end_frame is None
and reference_images is None
):
raise ValueError(
"Duration is only supported for 5 or 10 seconds if there is no end frame or reference images."
)
multi_shot = None
multi_prompt_list = None
if stories_enabled:
count = int(storyboards["storyboards"].split()[0])
multi_shot = True
multi_prompt_list = []View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Disconnect one of the two inputs: keep end_frame for last-frame control, or keep reference_images for style/subject references
- If you need both a reference and a specific final frame, bake the reference into first_frame or the prompt and keep only end_frame
- Run two passes: generate with reference_images, then use the last output frame as end_frame in a second node
Example fix
// before end_frame = load_last_frame.output reference_images = load_reference_batch.output // after end_frame = load_last_frame.output reference_images = None # pick one control mode per request
Defensive patterns
Strategy: validation
Validate before calling
def end_frame_reference_ok(end_frame, reference_images) -> bool:
return end_frame is None or reference_images is None Prevention
- Model the node inputs as an explicit union: one control mode per request (end_frame XOR reference_images)
- In UI-less pipelines, assert at most one of the two is non-None before queueing
When it happens
Trigger: Connecting tensors to both the end_frame input and the reference_images input of the OmniPro first/last frame node in the same graph.
Common situations: A template workflow uses reference_images for character consistency; a user adds an end frame for a controlled ending without disconnecting the reference image batch, or vice versa after copying a node.
Related errors
- The 'end_frame' input cannot be used simultaneously with sto
- Duration is only supported for 5 or 10 seconds if there is n
- The maximum number of reference images allowed is 6.
- The maximum number of reference images is 7.
- The maximum number of reference images allowed with a video
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/8b5ad1a5af1bc2b3.
Report an issue: GitHub.