Comfy-Org/ComfyUI · error · ValueError
Video width must be at least {min_width}px, got {width}px
Error message
Video width must be at least {min_width}px, got {width}px What it means
ValueError from validate_video_dimensions when the video's width is below the node/API minimum. Width/height come from video.get_dimensions() on an Input.Video object; if that call itself throws, the validator logs and silently returns (no error), so this raise only happens with a successfully-read but undersized video.
Source
Thrown at comfy_api_nodes/util/validation_utils.py:110
_assert_ratio_bounds(ar, min_ratio=min_ratio, max_ratio=max_ratio, strict=strict)
return ar
def validate_video_dimensions(
video: Input.Video,
min_width: int | None = None,
max_width: int | None = None,
min_height: int | None = None,
max_height: int | None = None,
):
try:
width, height = video.get_dimensions()
except Exception as e:
logging.error("Error getting dimensions of video: %s", e)
return
if min_width is not None and width < min_width:
raise ValueError(f"Video width must be at least {min_width}px, got {width}px")
if max_width is not None and width > max_width:
raise ValueError(f"Video width must be at most {max_width}px, got {width}px")
if min_height is not None and height < min_height:
raise ValueError(f"Video height must be at least {min_height}px, got {height}px")
if max_height is not None and height > max_height:
raise ValueError(f"Video height must be at most {max_height}px, got {height}px")
def validate_video_duration(
video: Input.Video,
min_duration: float | None = None,
max_duration: float | None = None,
):
try:
duration = video.get_duration()
except Exception as e:
logging.error("Error getting duration of video: %s", e)
returnView on GitHub (pinned to 1c6d8d45b3)
Solutions
- Upscale or re-export the video so width >= min_width.
- Use higher-resolution source footage.
- Pick a node/provider with lower minimum width requirements.
Defensive patterns
Strategy: validation
Validate before calling
width, height = video.get_dimensions()
if width < MIN_W:
raise ValueError(f"video too narrow: {width}px < {MIN_W}px") Prevention
- Check provider minimum resolution before exporting footage
- Prefer HD-or-wider source clips for video API nodes
When it happens
Trigger: validate_video_dimensions(video, min_width=N) with width < N — e.g., a 480px-wide clip passed to a video API node requiring min_width=768.
Common situations: Low-resolution source footage; mobile-landscape clips fed to providers with HD minimums; downscaling in the workflow before the API node.
Related errors
- Video width must be at most {max_width}px, got {width}px
- Video height must be at least {min_height}px, got {height}px
- Video height must be at most {max_height}px, got {height}px
- ar_video sampler requires 5-D video latents [B,C,T,H,W], got
- unknown merge strategy {self.merge_strategy}
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/06023f173af7717c.
Report an issue: GitHub.