Perfect Video Resolution
Stop guessing video resolutions — one dropdown for Wan, MiniMax H3, and LTX
- image
- image2
- mask
- width
- height
- IMAGE
- IMAGE2
- MASK
- resolution_info
Video models are absurdly picky about canvas size, and none of them will tell you what to feed them. Wan 2.2 wants multiples of 16 and behaves best at a small set of "native" sizes; LTX hard-fails on dimensions that aren't divisible by 32; MiniMax H3 mostly cares about total pixels. Pick wrong and you either OOM, or get a silently cropped composition, or - the classic - run an image-to-video job where the input frame never matches the latent resolution. Perfect Video Resolution is the node that swallows that whole lookup table: you pick a model, an aspect, and a quality tier, and it hands you exact width/height values plus an input image (and mask) resized to match.
What it actually is
It's a single utils-category node that merges two older utilities - ashtar1984's comfyui-find-perfect-resolution and boobkake22's ComfyUI-WanResolutions - and extends them to three model families. It has no Python dependencies beyond what ComfyUI already ships (the pyproject.toml declares none), downloads no model files, and touches no network at runtime. The whole thing is a preset table plus a PIL-based resizer, which is exactly what a resolution node should be. The heavy lifting is elsewhere in your graph; this just makes sure the numbers feeding it are sane.
How it decides
Pick model (WAN 2.2, MiniMax H3, or LTX) and the node's front-end JS repopulates the other two dropdowns on the fly - each model gets its own aspect-ratio list and its own tier labels. Wan 2.2's tiers run Fast Draft → Preview → High Detail → Wan 2.2 Native (so 480×480 up to 960×960 square, and 1280×720 at 16:9, which is exactly the 720p the community treats as Wan's quality ceiling without speed LoRAs). LTX tiers top out at Full HD Output; MiniMax H3 goes up to "2K" class sizes and adds 21:9.
Two behaviors matter when an image is wired in. First, the node stops trusting your aspect_ratio pick: it measures the source, finds the closest supported ratio, and snaps to it - then after the run it even rewrites the dropdowns to show what it actually used. Second, MiniMax H3 doesn't use fixed sizes at all when an image is present; it keeps your frame's aspect and hits a pixel budget per tier via an adaptive-size calculation. Everything gets rounded to divisible_by (default 16 for Wan, 32 for the other two - matching what each model's VAE expects; LTX genuinely refuses off-grid dimensions).
The inputs you'll actually touch
Most of the widget row is fire-and-forget, but three deserve your attention:
resolution- the tier picker. Draft tiers for blocking out motion, High Detail/Native for the real render. This is where you feel the VRAM trade: each step up is a sizable pixel jump, and the 1080P-class and 2K tiers on MiniMax are genuinely heavy.upscale- off by default, and it's a trap (below).small_image_mode(none/crop/pad) - how a source smaller than the target is treated, withpad_colorfor the background when padding.
Outputs are width, height, resized IMAGE/IMAGE2/MASK, and a resolution_info string that reads like 960x960 | 2.64MB | 921,600 pixels. Wire width and height into your sampler or latent generator; feed IMAGE into I2V/FL2V/SVI. Leave image2/mask unconnected and you get placeholder tensors (black image, white mask), not errors.
The I2V gotcha
Here's where people get burned. With upscale off and small_image_mode set to none, the node will happily report a 960×960 target while leaving your 512-pixel source image at its native size - the code only resizes down, never up, unless you tell it to. Your latent says 960×960 and your conditioning image says 512×512, and video models are not forgiving about that mismatch. If your input image is smaller than your chosen tier, enable upscale (lanczos is the default and fine) or pick crop/pad. If it's already bigger than the target, don't worry - it gets downscaled regardless.
Install
Via ComfyUI Manager, search "Perfect Video Resolution" and install; or clone it yourself:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/huchukato/ComfyUI-PerfectVideoResolution.git
Then restart ComfyUI. No models, no extra pip installs, no config. Note it's brand-new and tiny - MiniMax's aspect-ratio list is the shortest (no 2:3 or 3:2, but it does get 21:9), and if a tier you want isn't in the presets yet, divisible_by plus the upscale/crop/pad knobs are your escape hatch rather than a bug.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | WAN 2.2 | 3 options: WAN 2.2, MiniMax H3, LTX |
| aspect_ratio | COMBO | 1:1 | 7 options: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, +1 |
| resolution | COMBO | Fast Draft — 480×480 | 4 options: Fast Draft — 480×480, Preview — 640×640, High Detail — 832×832, Wan 2.2 Native — 960×960 |
| divisible_by | INT | 161–128 | — |
| upscale | BOOLEAN | false | — |
| upscale_method | COMBO | lanczos | 4 options: lanczos, bilinear, bicubic, nearest |
| small_image_mode | COMBO | none | 3 options: none, crop, pad |
| pad_color | STRING | #000000 | — |
| imageopt | IMAGE | — | |
| image2opt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| IMAGE | IMAGE | — |
| IMAGE2 | IMAGE | — |
| MASK | MASK | — |
| resolution_info | STRING | — |