{"record":{"id":"2c716bd162e11b53","repo":"Comfy-Org/ComfyUI","slug":"selected-resolution-resolution-target-size-p","errorCode":null,"errorMessage":"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'.","messagePattern":"Selected resolution (.+?) \\((.+?)p\\) is smaller than the input video's shorter dimension \\((.+?)p\\)\\. Please select a higher resolution or 'original'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_hitpaw.py","lineNumber":291,"sourceCode":"\n        if resolution == \"original\":\n            output_width = src_width\n            output_height = src_height\n        else:\n            if src_width == src_height:\n                target_size = RESOLUTION_SQUARE_MAP[resolution]\n                if target_size < src_width:\n                    raise ValueError(\n                        f\"Selected resolution {resolution} ({target_size}x{target_size}) is smaller than \"\n                        f\"the input video ({src_width}x{src_height}). Please select a higher resolution or 'original'.\"\n                    )\n                output_width = target_size\n                output_height = target_size\n            else:\n                min_dimension = min(src_width, src_height)\n                target_size = RESOLUTION_TARGET_MAP[resolution]\n                if target_size < min_dimension:\n                    raise ValueError(\n                        f\"Selected resolution {resolution} ({target_size}p) is smaller than \"\n                        f\"the input video's shorter dimension ({min_dimension}p). \"\n                        f\"Please select a higher resolution or 'original'.\"\n                    )\n                if src_width > src_height:\n                    output_height = target_size\n                    output_width = int(target_size * (src_width / src_height))\n                else:\n                    output_width = target_size\n                    output_height = int(target_size * (src_height / src_width))\n        initial_res = await sync_op(\n            cls,\n            ApiEndpoint(path=\"/proxy/hitpaw/api/video-enhancer\", method=\"POST\"),\n            response_model=TaskCreateResponse,\n            data=VideoEnhanceTaskCreateRequest(\n                video_url=await upload_video_to_comfyapi(cls, video),\n                resolution=[output_width, output_height],\n                original_resolution=[src_width, src_height],","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_hitpaw.py#L273-L309","documentation":"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.","triggerScenarios":"e.g. a 2560x1440 video with resolution '1080' (target 1080 < 1440) — enhancement would shrink the video, so it errors instead.","commonSituations":"HD-or-larger footage combined with a sub-source 'p' setting; default resolution widget value smaller than the fed video.","solutions":["Choose a resolution at or above the video's shorter dimension (1440p+ for 1440p sources), or 'original'","Or intentionally pre-downscale the video first if a smaller output is actually desired"],"exampleFix":"# before: 2560x1440 video, resolution='1080' -> error\n# after: resolution='original'  # or '1440'/'2160'","handlingStrategy":"validation","validationCode":"from comfy_api_nodes.nodes_hitpaw import RESOLUTION_TARGET_MAP\n\ndef target_resolution_ok(video, resolution: str) -> bool:\n    if resolution == 'original':\n        return True\n    w, h = video.get_dimensions()\n    if w == h:\n        return True  # handled by the square branch\n    return RESOLUTION_TARGET_MAP[resolution] >= min(w, h)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compare the chosen 'p' value against the video's shorter side before running","Pick 'original' for already-high-resolution sources to avoid needless upscaling cost"],"tags":["hitpaw","video-enhance","resolution","aspect-ratio"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}