Comfy-Org/ComfyUI · error · ValueError

Provide only one of last_frame or last_frame_asset_id, not b

Error message

Provide only one of last_frame or last_frame_asset_id, not both.

What it means

Same mutual-exclusion rule as the first frame, applied to the optional last frame: the node accepts last_frame as either an image tensor or an asset id string (last_frame_asset_id), but not both. The last frame is optional, so emptying one of the two inputs fully resolves the conflict.

Source

Thrown at comfy_api_nodes/nodes_bytedance.py:2503

        seed: int,
        watermark: bool,
        first_frame: Input.Image | None = None,
        last_frame: Input.Image | None = None,
        first_frame_asset_id: str = "",
        last_frame_asset_id: str = "",
    ) -> IO.NodeOutput:
        validate_string(model["prompt"], strip_whitespace=True, min_length=1)
        model_id = SEEDANCE_MODELS[model["model"]]

        first_frame_asset_id = first_frame_asset_id.strip()
        last_frame_asset_id = last_frame_asset_id.strip()

        if first_frame is not None and first_frame_asset_id:
            raise ValueError("Provide only one of first_frame or first_frame_asset_id, not both.")
        if first_frame is None and not first_frame_asset_id:
            raise ValueError("Either first_frame or first_frame_asset_id is required.")
        if last_frame is not None and last_frame_asset_id:
            raise ValueError("Provide only one of last_frame or last_frame_asset_id, not both.")

        if model_id == "dreamina-seedance-2-5-260628":
            # 2.5 accepts ratio="adaptive" only here and keeps the first frame's own aspect
            # (a 1920x1088 frame yields 850x482, not a grid ratio), so pre-sizing the frames to a
            # supported pixel pair would crop framing the model would otherwise have preserved.
            request_ratio = "adaptive"
            if first_frame is not None:
                first_frame = _prepare_seedance_image(first_frame)
            if last_frame is not None:
                last_frame = _prepare_seedance_image(last_frame)
        elif first_frame_asset_id or last_frame_asset_id:
            request_ratio = model["ratio"]
            if first_frame is not None:
                first_frame = _prepare_seedance_image(first_frame)
            if last_frame is not None:
                last_frame = _prepare_seedance_image(last_frame)
        else:
            # The 1080p FLF stretch fix (pre-size frames to a supported pixel pair + submit ratio="adaptive")

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Clear the last_frame_asset_id widget if feeding the image directly.
  2. Or disconnect the last_frame image to use the asset id.
Defensive patterns

Strategy: validation

Validate before calling

if last_frame is not None and last_frame_asset_id.strip():
    raise ValueError("pass only one of last_frame / last_frame_asset_id")

Prevention

When it happens

Trigger: Calling the keyframe node with last_frame wired AND a non-empty last_frame_asset_id.

Common situations: Leftover asset id from a previous run kept in the widget after switching to direct image input.

Related errors


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