{"record":{"id":"c9dc84b47040cdde","repo":"Comfy-Org/ComfyUI","slug":"video-height-must-be-at-most-max-height-px-got","errorCode":null,"errorMessage":"Video height must be at most {max_height}px, got {height}px","messagePattern":"Video height must be at most (.+?)px, got (.+?)px","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/util/validation_utils.py","lineNumber":116,"sourceCode":"    min_width: int | None = None,\n    max_width: int | None = None,\n    min_height: int | None = None,\n    max_height: int | None = None,\n):\n    try:\n        width, height = video.get_dimensions()\n    except Exception as e:\n        logging.error(\"Error getting dimensions of video: %s\", e)\n        return\n\n    if min_width is not None and width < min_width:\n        raise ValueError(f\"Video width must be at least {min_width}px, got {width}px\")\n    if max_width is not None and width > max_width:\n        raise ValueError(f\"Video width must be at most {max_width}px, got {width}px\")\n    if min_height is not None and height < min_height:\n        raise ValueError(f\"Video height must be at least {min_height}px, got {height}px\")\n    if max_height is not None and height > max_height:\n        raise ValueError(f\"Video height must be at most {max_height}px, got {height}px\")\n\n\ndef validate_video_duration(\n    video: Input.Video,\n    min_duration: float | None = None,\n    max_duration: float | None = None,\n):\n    try:\n        duration = video.get_duration()\n    except Exception as e:\n        logging.error(\"Error getting duration of video: %s\", e)\n        return\n\n    epsilon = 0.0001\n    if min_duration is not None and min_duration - epsilon > duration:\n        raise ValueError(f\"Video duration must be at least {min_duration}s, got {duration}s\")\n    if max_duration is not None and duration > max_duration + epsilon:\n        raise ValueError(f\"Video duration must be at most {max_duration}s, got {duration}s\")","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/util/validation_utils.py#L98-L134","documentation":"ValueError from validate_video_dimensions when the video's height exceeds the allowed maximum. Enforced locally after a successful get_dimensions() call, mirroring the other dimension bounds, so oversized videos fail before consuming an upload slot or API credits.","triggerScenarios":"validate_video_dimensions(video, max_height=N) with height > N — e.g., a 2160px-tall 4K video into a node capping max_height=1280.","commonSituations":"Portrait/vertical 4K video; upscaled footage; provider caps lower than the source resolution.","solutions":["Downscale the video so height <= max_height (ffmpeg -vf scale=-2:1280).","Crop vertically if the composition allows.","Use a provider tier that accepts higher resolutions."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"_, height = video.get_dimensions()\nif height > MAX_H:\n    raise ValueError(f\"downscale first: {height}px > {MAX_H}px\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Downscale vertical/4K video before API nodes","Verify final export resolution with ffprobe"],"tags":["validation","video","dimensions"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}