{"record":{"id":"cf73cdac5d46af87","repo":"Comfy-Org/ComfyUI","slug":"reference-video-index-is-too-small-w-x-h-p","errorCode":null,"errorMessage":"Reference video {index} is too small: {w}x{h} = {pixels:,} total pixels. Minimum for this model is {min_px:,} total pixels.","messagePattern":"Reference video (.+?) is too small: (.+?)x(.+?) = (.+?) total pixels\\. Minimum for this model is (.+?) total pixels\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":145,"sourceCode":"\n\ndef _validate_ref_video_pixels(video: Input.Video, model_id: str, resolution: str, index: int) -> None:\n    \"\"\"Validate reference video pixel count against Seedance 2.0 model limits for the selected resolution.\"\"\"\n    model_limits = SEEDANCE2_REF_VIDEO_PIXEL_LIMITS.get(model_id)\n    if not model_limits:\n        return\n    limits = model_limits.get(resolution)\n    if not limits:\n        return\n    try:\n        w, h = video.get_dimensions()\n    except Exception:\n        return\n    pixels = w * h\n    min_px = limits.get(\"min\")\n    max_px = limits.get(\"max\")\n    if min_px and pixels < min_px:\n        raise ValueError(\n            f\"Reference video {index} is too small: {w}x{h} = {pixels:,} total pixels. \"\n            f\"Minimum for this model is {min_px:,} total pixels.\"\n        )\n    if max_px and pixels > max_px:\n        raise ValueError(\n            f\"Reference video {index} is too large: {w}x{h} = {pixels:,} total pixels. \"\n            f\"Maximum for this model is {max_px:,} total pixels. Try downscaling the video.\"\n        )\n\n\ndef _prepare_seedance_image(image: Input.Image) -> Input.Image:\n    \"\"\"Auto-downscale a Seedance image input to the per-side limits, then validate it.\"\"\"\n    validate_image_aspect_ratio(image, (2, 5), (5, 2), strict=False)  # 0.4 to 2.5\n    image = downscale_image_tensor_by_max_side(image, max_side=6000)\n    validate_image_dimensions(image, min_width=300, min_height=300, max_width=6000, max_height=6000)\n    return image\n\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L127-L163","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upscale or re-export the reference video to meet the minimum total pixel count shown in the message.","Pick a resolution/model preset with a lower min limit if available.","Drop the undersized reference from the reference list."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"w, h = ref_video.get_dimensions()\nlimits = model_limits.get(resolution, {})\nif limits.get('min') and w * h < limits['min']:\n    raise UserError(f'Reference video below {limits[\"min\"]:,} px - upscale it first.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-size reference videos to the model's pixel budget with ffmpeg or a resize node.","Check the model_limits table for the chosen resolution before preparing references."],"tags":["comfyui","seedance","bytedance","video","limits","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}