{"record":{"id":"8b5ad1a5af1bc2b3","repo":"Comfy-Org/ComfyUI","slug":"the-end-frame-input-cannot-be-used-simultaneousl","errorCode":null,"errorMessage":"The 'end_frame' input cannot be used simultaneously with 'reference_images'.","messagePattern":"The 'end_frame' input cannot be used simultaneously with 'reference_images'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_kling.py","lineNumber":880,"sourceCode":"        storyboards: dict | None = None,\n        generate_audio: bool = False,\n        seed: int = 0,\n    ) -> IO.NodeOutput:\n        _ = seed\n        if model_name == \"kling-video-o1\":\n            if duration > 10:\n                raise ValueError(\"kling-video-o1 does not support durations greater than 10 seconds.\")\n            if generate_audio:\n                raise ValueError(\"kling-video-o1 does not support audio generation.\")\n            if resolution == \"4k\":\n                raise ValueError(\"kling-video-o1 does not support 4k resolution.\")\n        stories_enabled = storyboards is not None and storyboards[\"storyboards\"] != \"disabled\"\n        if stories_enabled and model_name == \"kling-video-o1\":\n            raise ValueError(\"kling-video-o1 does not support storyboards.\")\n        prompt = normalize_omni_prompt_references(prompt)\n        validate_string(prompt, strip_whitespace=True, min_length=0 if stories_enabled else 1, max_length=2500)\n        if end_frame is not None and reference_images is not None:\n            raise ValueError(\"The 'end_frame' input cannot be used simultaneously with 'reference_images'.\")\n        if end_frame is not None and stories_enabled:\n            raise ValueError(\"The 'end_frame' input cannot be used simultaneously with storyboards.\")\n        if (\n            model_name == \"kling-video-o1\"\n            and duration not in (5, 10)\n            and end_frame is None\n            and reference_images is None\n        ):\n            raise ValueError(\n                \"Duration is only supported for 5 or 10 seconds if there is no end frame or reference images.\"\n            )\n\n        multi_shot = None\n        multi_prompt_list = None\n        if stories_enabled:\n            count = int(storyboards[\"storyboards\"].split()[0])\n            multi_shot = True\n            multi_prompt_list = []","sourceCodeStart":862,"sourceCodeEnd":898,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_kling.py#L862-L898","documentation":"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.","triggerScenarios":"Connecting tensors to both the end_frame input and the reference_images input of the OmniPro first/last frame node in the same graph.","commonSituations":"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.","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"],"exampleFix":"// before\nend_frame = load_last_frame.output\nreference_images = load_reference_batch.output\n\n// after\nend_frame = load_last_frame.output\nreference_images = None  # pick one control mode per request","handlingStrategy":"validation","validationCode":"def end_frame_reference_ok(end_frame, reference_images) -> bool:\n    return end_frame is None or reference_images is None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["kling","video","input-validation","mutual-exclusion","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}