Comfy-Org/ComfyUI · error · ValueError
Either first_frame or first_frame_asset_id is required.
Error message
Either first_frame or first_frame_asset_id is required.
What it means
The keyframe Seedance node requires a first frame to anchor the generation; neither the first_frame image input nor the first_frame_asset_id string was provided. Unlike the general reference node, this i2v-style path cannot run text-only, so the node fails fast before uploading or polling anything.
Source
Thrown at comfy_api_nodes/nodes_bytedance.py:2501
cls,
model: dict,
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)View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Connect an image to first_frame.
- Or paste a valid uploaded asset id into first_frame_asset_id (from the asset upload node's output).
Defensive patterns
Strategy: validation
Validate before calling
if first_frame is None and not first_frame_asset_id.strip():
raise ValueError("first frame required: wire first_frame or set first_frame_asset_id") Prevention
- Always wire a first frame; this node has no text-only path.
- For pure text-to-video use the t2v Seedance node instead.
When it happens
Trigger: Calling the first/last-frame node with first_frame left unwired and an empty/whitespace first_frame_asset_id string.
Common situations: Converting a t2v workflow to the keyframe node without wiring the frame; asset id typo that strips to empty; partially copied node configs.
Related errors
- At least one reference image or video or asset is required.
- Provide only one of first_frame or first_frame_asset_id, not
- Provide only one of last_frame or last_frame_asset_id, not b
- Asset {aid} is not an Image asset.
- Too many reference images: {total_images} (images={len(refer
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/a291311f091e6610.
Report an issue: GitHub.