Comfy-Org/ComfyUI · error · ValueError

First/last frame and reference media are mutually exclusive.

Error message

First/last frame and reference media are mutually exclusive. Use frames for an image-to-video prompt, or reference media for a reference-to-video prompt.

What it means

Error "First/last frame and reference media are mutually exclusive. Use frames for an image-to-video prompt, or reference media for a reference-to-video prompt." thrown in Comfy-Org/ComfyUI.

Source

Thrown at comfy_api_nodes/nodes_minimax.py:1096

        reference_images = {k: v for k, v in (model.get("reference_images") or {}).items() if v is not None}
        reference_videos = {k: v for k, v in (model.get("reference_videos") or {}).items() if v is not None}
        reference_audios = {k: v for k, v in (model.get("reference_audios") or {}).items() if v is not None}
        has_frames = first_frame is not None or last_frame is not None
        has_references = bool(reference_images) or bool(reference_videos) or bool(reference_audios)
        if has_frames and has_references:
            raise ValueError(
                "First/last frame and reference media are mutually exclusive. Use frames for an "
                "image-to-video prompt, or reference media for a reference-to-video prompt."
            )

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Use either first/last frames or reference media, not both.

When it happens

Trigger: Thrown at comfy_api_nodes/nodes_minimax.py:1096 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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