Comfy-Org/ComfyUI · error · ValueError

Asset {aid} is not an Image asset.

Error message

Asset {aid} is not an Image asset.

What it means

After _resolve_reference_assets resolves the requested asset ids, the node checks each id maps to an entry in the image-asset dict. If the id exists but resolved as a Video or Audio asset (or otherwise is absent from the image mapping), it is not usable as a first/last frame, so the node raises with the offending id.

Source

Thrown at comfy_api_nodes/nodes_bytedance.py:2543

            if first_frame is not None:
                validate_image_aspect_ratio(first_frame, (2, 5), (5, 2), strict=False)  # 0.4 to 2.5
                validate_image_dimensions(first_frame, min_width=300, min_height=300)
                target_dims = _seedance2_target_dims(model["resolution"], model["ratio"], first_frame)
                first_frame = _resize_to_exact(first_frame, *target_dims)
            if last_frame is not None:
                validate_image_aspect_ratio(last_frame, (2, 5), (5, 2), strict=False)  # 0.4 to 2.5
                validate_image_dimensions(last_frame, min_width=300, min_height=300)
                if target_dims is None:
                    target_dims = _seedance2_target_dims(model["resolution"], model["ratio"], last_frame)
                last_frame = _resize_to_exact(last_frame, *target_dims)

        asset_ids_to_resolve = [a for a in (first_frame_asset_id, last_frame_asset_id) if a]
        image_assets: dict[str, str] = {}
        if asset_ids_to_resolve:
            image_assets, _, _ = await _resolve_reference_assets(cls, asset_ids_to_resolve)
            for aid in asset_ids_to_resolve:
                if aid not in image_assets:
                    raise ValueError(f"Asset {aid} is not an Image asset.")

        if first_frame_asset_id:
            first_frame_url = image_assets[first_frame_asset_id]
        else:
            first_frame_url = await _seedance_virtual_library_upload_image_asset(
                cls, first_frame, wait_label="Uploading first frame."
            )

        content: list[TaskTextContent | TaskImageContent] = [
            TaskTextContent(text=model["prompt"]),
            TaskImageContent(
                image_url=TaskImageContentUrl(url=first_frame_url),
                role="first_frame",
            ),
        ]
        if last_frame_asset_id:
            content.append(
                TaskImageContent(

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Re-upload the frame with the image asset node (asset_type Image) and use that asset_id.
  2. Feed the image directly through first_frame/last_frame instead of asset ids.
  3. Verify the id in the Comfy asset library and confirm its type is Image.
Defensive patterns

Strategy: type-guard

Validate before calling

image_assets, _, _ = await _resolve_reference_assets(cls, [aid])
assert aid in image_assets, f"{aid} is not an Image asset"

Type guard

def is_image_asset_id(image_assets: dict[str, str], aid: str) -> bool:
    return aid in image_assets

Prevention

When it happens

Trigger: Passing a first_frame_asset_id or last_frame_asset_id that refers to an asset created with asset_type="Video" or an audio asset instead of "Image" (see the Create Seedance Asset nodes), or an id that failed to resolve into the image category.

Common situations: Copy-pasting the wrong asset_id from the progress text printed by an asset upload node; reusing ids from a video-reference workflow in the keyframe node.

Related errors


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