Comfy-Org/ComfyUI · error · ValueError

Reference video {index} is too small: {w}x{h} = {pixels:,} t

Error message

Reference video {index} is too small: {w}x{h} = {pixels:,} total pixels. Minimum for this model is {min_px:,} total pixels.

What it means

Seedance reference-video validation: each model/resolution entry in model_limits may define a minimum total pixel count. When a reference video's w*h falls below limits['min'], the node rejects it before upload because the API would produce degraded or rejected results.

Source

Thrown at comfy_api_nodes/nodes_bytedance.py:145


def _validate_ref_video_pixels(video: Input.Video, model_id: str, resolution: str, index: int) -> None:
    """Validate reference video pixel count against Seedance 2.0 model limits for the selected resolution."""
    model_limits = SEEDANCE2_REF_VIDEO_PIXEL_LIMITS.get(model_id)
    if not model_limits:
        return
    limits = model_limits.get(resolution)
    if not limits:
        return
    try:
        w, h = video.get_dimensions()
    except Exception:
        return
    pixels = w * h
    min_px = limits.get("min")
    max_px = limits.get("max")
    if min_px and pixels < min_px:
        raise ValueError(
            f"Reference video {index} is too small: {w}x{h} = {pixels:,} total pixels. "
            f"Minimum for this model is {min_px:,} total pixels."
        )
    if max_px and pixels > max_px:
        raise ValueError(
            f"Reference video {index} is too large: {w}x{h} = {pixels:,} total pixels. "
            f"Maximum for this model is {max_px:,} total pixels. Try downscaling the video."
        )


def _prepare_seedance_image(image: Input.Image) -> Input.Image:
    """Auto-downscale a Seedance image input to the per-side limits, then validate it."""
    validate_image_aspect_ratio(image, (2, 5), (5, 2), strict=False)  # 0.4 to 2.5
    image = downscale_image_tensor_by_max_side(image, max_side=6000)
    validate_image_dimensions(image, min_width=300, min_height=300, max_width=6000, max_height=6000)
    return image

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Upscale or re-export the reference video to meet the minimum total pixel count shown in the message.
  2. Pick a resolution/model preset with a lower min limit if available.
  3. Drop the undersized reference from the reference list.
Defensive patterns

Strategy: validation

Validate before calling

w, h = ref_video.get_dimensions()
limits = model_limits.get(resolution, {})
if limits.get('min') and w * h < limits['min']:
    raise UserError(f'Reference video below {limits["min"]:,} px - upscale it first.')

Prevention

When it happens

Trigger: A Seedance video node with a reference video whose get_dimensions() yields fewer total pixels than the min for the chosen resolution/model; limits lookup succeeded (resolution key present in model_limits). Failures to read dimensions are silently skipped - only readable-but-too-small videos raise.

Common situations: Low-resolution reference clips (e.g. 240p previews, thumbnails) wired as style references; resolution preset changed to one with stricter limits after the reference was chosen.

Related errors


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