Comfy-Org/ComfyUI · error · ValueError

Selected resolution {resolution} ({target_size}x{target_size

Error message

Selected resolution {resolution} ({target_size}x{target_size}) is smaller than the input video ({src_width}x{src_height}). Please select a higher resolution or 'original'.

What it means

Thrown by Hitpaw video enhancement for square input videos (src_width == src_height) when the selected resolution maps (via RESOLUTION_SQUARE_MAP) to a target smaller than the source. Enhancing below source resolution would downscale the video, which the node blocks; the message suggests a higher resolution or 'original'.

Source

Thrown at comfy_api_nodes/nodes_hitpaw.py:281

    @classmethod
    async def execute(
        cls,
        model: InputVideoModel,
        video: Input.Video,
    ) -> IO.NodeOutput:
        validate_video_duration(video, min_duration=0.5, max_duration=60 * 60)
        resolution = model["resolution"]
        src_width, src_height = video.get_dimensions()

        if resolution == "original":
            output_width = src_width
            output_height = src_height
        else:
            if src_width == src_height:
                target_size = RESOLUTION_SQUARE_MAP[resolution]
                if target_size < src_width:
                    raise ValueError(
                        f"Selected resolution {resolution} ({target_size}x{target_size}) is smaller than "
                        f"the input video ({src_width}x{src_height}). Please select a higher resolution or 'original'."
                    )
                output_width = target_size
                output_height = target_size
            else:
                min_dimension = min(src_width, src_height)
                target_size = RESOLUTION_TARGET_MAP[resolution]
                if target_size < min_dimension:
                    raise ValueError(
                        f"Selected resolution {resolution} ({target_size}p) is smaller than "
                        f"the input video's shorter dimension ({min_dimension}p). "
                        f"Please select a higher resolution or 'original'."
                    )
                if src_width > src_height:
                    output_height = target_size
                    output_width = int(target_size * (src_width / src_height))
                else:

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Select a resolution whose square target is >= the source side, or 'original' to keep source dimensions
  2. Or pre-downscale the square video to below the chosen target before the node

Example fix

# before: 1024x1024 input, resolution='720' -> error
# after: resolution='1080'  # or 'original'
Defensive patterns

Strategy: validation

Validate before calling

from comfy_api_nodes.nodes_hitpaw import RESOLUTION_SQUARE_MAP

def square_resolution_ok(video, resolution: str) -> bool:
    if resolution == 'original':
        return True
    w, h = video.get_dimensions()
    return w != h or RESOLUTION_SQUARE_MAP[resolution] >= w

Prevention

When it happens

Trigger: Input video is square (e.g. 1024x1024) and resolution is set to a square target smaller than 1024 (e.g. '720'), producing target_size < src_width.

Common situations: Square AI-generated videos fed with a default 720p-style resolution widget; users assuming the setting is an output cap rather than a floor.

Related errors


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