{"record":{"id":"385a26ab5b86a728","repo":"Comfy-Org/ComfyUI","slug":"currently-only-one-last-frame-image-is-supported","errorCode":null,"errorMessage":"Currently only one last frame image is supported.","messagePattern":"Currently only one last frame image is supported\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"comfy_api_nodes/nodes_ltxv.py","lineNumber":484,"sourceCode":"        )\n\n    @classmethod\n    async def execute(\n        cls,\n        image: Input.Image,\n        model: dict,\n        prompt: str,\n        seed: int = 42,\n        last_frame: Input.Image | None = None,\n    ) -> IO.NodeOutput:\n        validate_string(prompt, min_length=1, max_length=10000)\n        _v25_validate_settings(model)\n        if get_number_of_images(image) != 1:\n            raise ValueError(\"Currently only one input image is supported.\")\n        last_frame_uri = None\n        if last_frame is not None:\n            if get_number_of_images(last_frame) != 1:\n                raise ValueError(\"Currently only one last frame image is supported.\")\n            last_frame_uri = (await upload_images_to_comfyapi(cls, last_frame, max_images=1, mime_type=\"image/png\"))[0]\n        return await _v25_submit_and_poll(\n            cls,\n            \"image-to-video\",\n            ExecuteTaskRequest(\n                image_uri=(await upload_images_to_comfyapi(cls, image, max_images=1, mime_type=\"image/png\"))[0],\n                last_frame_uri=last_frame_uri,\n                prompt=prompt,\n                model=V25_MODELS_MAP[model[\"model\"]],\n                duration=int(model[\"duration\"]),\n                resolution=model[\"resolution\"],\n                fps=int(model[\"fps\"]),\n                generate_audio=model[\"generate_audio\"],\n            ),\n        )\n\n\nclass Ltx25AudioToVideoNode(IO.ComfyNode):","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_ltxv.py#L466-L502","documentation":"Client-side ValueError in the v2.5 LTX image-to-video node: the optional last_frame input, when connected, must also contain exactly one image. Raised only when last_frame is not None and its image count != 1.","triggerScenarios":"Connecting a batched or empty IMAGE tensor to the last_frame input of the v2.5 image-to-video node — e.g. both start and end frames loaded as batches, or last_frame sourced from a video frame stack.","commonSituations":"First/last-frame workflows where both endpoints come from batch loaders; last frame from a decoded video where the whole stack is connected instead of one frame.","solutions":["Reduce the last_frame input to a single image (batch 1 or pick one frame).","If last frame isn't needed, disconnect the input entirely — it is optional.","Use the same single-image discipline for both image and last_frame inputs."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if last_frame is not None:\n    assert last_frame.shape[0] == 1, \"last_frame must be a single image\"","typeGuard":"def is_single_image(t: torch.Tensor | None) -> bool:\n    return t is None or t.shape[0] == 1","tryCatchPattern":null,"preventionTips":["Load the end frame as a single image, mirroring the start frame.","Disconnect last_frame when not doing first/last-frame generation."],"tags":["ltx","api-nodes","validation","image-batch","last-frame","pre-flight"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}