Comfy-Org/ComfyUI · error · Exception

At least one of first_image and last_image requires an input

Error message

At least one of first_image and last_image requires an input.

What it means

Raised by the legacy Luma keyframe video node (comfy_api_nodes/nodes_luma.py:561) when both first_image and last_image are None. The Luma generations API requires at least one keyframe image to anchor the video, so the node fails fast before calling _convert_to_keyframes or the remote endpoint.

Source

Thrown at comfy_api_nodes/nodes_luma.py:561

            is_api_node=True,
            price_badge=PRICE_BADGE_VIDEO,
        )

    @classmethod
    async def execute(
        cls,
        prompt: str,
        model: str,
        resolution: str,
        duration: str,
        loop: bool,
        seed,
        first_image: torch.Tensor = None,
        last_image: torch.Tensor = None,
        luma_concepts: LumaConceptChain = None,
    ) -> IO.NodeOutput:
        if first_image is None and last_image is None:
            raise Exception("At least one of first_image and last_image requires an input.")
        keyframes = await cls._convert_to_keyframes(first_image, last_image)
        duration = duration if model != LumaVideoModel.ray_1_6 else None
        resolution = resolution if model != LumaVideoModel.ray_1_6 else None
        response_api = await sync_op(
            cls,
            ApiEndpoint(path="/proxy/luma/generations", method="POST"),
            response_model=LumaGeneration,
            data=LumaGenerationRequest(
                prompt=prompt,
                model=model,
                aspect_ratio=LumaAspectRatio.ratio_16_9,  # ignored, but still needed by the API for some reason
                resolution=resolution,
                duration=duration,
                loop=loop,
                keyframes=keyframes,
                concepts=luma_concepts.create_api_model() if luma_concepts else None,
            ),
        )

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Connect an image to first_image (start frame) or last_image (end frame).
  2. If you want prompt-only Luma video, use the dedicated text-to-video Luma node instead.
  3. Check for accidentally disconnected edges after graph refactors.
Defensive patterns

Strategy: validation

Validate before calling

if first_image is None and last_image is None:
    raise ValueError("Wire a start or end frame, or use the Luma text-to-video node")

Prevention

When it happens

Trigger: Executing LumaVideoNode (or the image-to-video variant) with neither first_image nor last_image wired, e.g. relying on prompt-only generation against a node whose schema demands a start or end frame.

Common situations: User copies a text-to-video workflow into the image-to-video node, or disconnects an image input during graph editing and re-runs the queue.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/fb93aee90a9b908d. Report an issue: GitHub.