Comfy-Org/ComfyUI · error · ValueError

Selected resolution {resolution} ({target_size}p) is smaller

Error message

Selected resolution {resolution} ({target_size}p) is smaller than the input video's shorter dimension ({min_dimension}p). Please select a higher resolution or 'original'.

What it means

Thrown by Hitpaw video enhancement for non-square videos when the selected resolution's short-side target (RESOLUTION_TARGET_MAP, i.e. the '...p' value) is smaller than min(src_width, src_height). The node maintains aspect ratio by scaling the shorter side to target_size, so a target below the current short side would downscale; the message names both pixel values.

Source

Thrown at comfy_api_nodes/nodes_hitpaw.py:291

        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:
                    output_width = target_size
                    output_height = int(target_size * (src_height / src_width))
        initial_res = await sync_op(
            cls,
            ApiEndpoint(path="/proxy/hitpaw/api/video-enhancer", method="POST"),
            response_model=TaskCreateResponse,
            data=VideoEnhanceTaskCreateRequest(
                video_url=await upload_video_to_comfyapi(cls, video),
                resolution=[output_width, output_height],
                original_resolution=[src_width, src_height],

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Choose a resolution at or above the video's shorter dimension (1440p+ for 1440p sources), or 'original'
  2. Or intentionally pre-downscale the video first if a smaller output is actually desired

Example fix

# before: 2560x1440 video, resolution='1080' -> error
# after: resolution='original'  # or '1440'/'2160'
Defensive patterns

Strategy: validation

Validate before calling

from comfy_api_nodes.nodes_hitpaw import RESOLUTION_TARGET_MAP

def target_resolution_ok(video, resolution: str) -> bool:
    if resolution == 'original':
        return True
    w, h = video.get_dimensions()
    if w == h:
        return True  # handled by the square branch
    return RESOLUTION_TARGET_MAP[resolution] >= min(w, h)

Prevention

When it happens

Trigger: e.g. a 2560x1440 video with resolution '1080' (target 1080 < 1440) — enhancement would shrink the video, so it errors instead.

Common situations: HD-or-larger footage combined with a sub-source 'p' setting; default resolution widget value smaller than the fed video.

Related errors


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