Nodes/ComfyUI-PerfectVideoResolution/Perfect Video Resolution
ComfyUI Node

Perfect Video Resolution

Stop guessing video resolutions — one dropdown for Wan, MiniMax H3, and LTX

By huchukato·Created 2 days ago·Updated a day ago· 2
Perfect Video Resolution
  • image
  • image2
  • mask
  • width
  • height
  • IMAGE
  • IMAGE2
  • MASK
  • resolution_info
modelWAN 2.2
aspect_ratio1:1
resolutionFast Draft — 480×480
divisible_by16
upscalefalse
upscale_methodlanczos
small_image_modenone
pad_color#000000

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, with pad_color for 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.

Categoryutils

Inputs (11)

NameTypeDefaultDescription
modelCOMBOWAN 2.23 options: WAN 2.2, MiniMax H3, LTX
aspect_ratioCOMBO1:17 options: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, +1
resolutionCOMBOFast Draft — 480×4804 options: Fast Draft — 480×480, Preview — 640×640, High Detail — 832×832, Wan 2.2 Native — 960×960
divisible_byINT161–128
upscaleBOOLEANfalse
upscale_methodCOMBOlanczos4 options: lanczos, bilinear, bicubic, nearest
small_image_modeCOMBOnone3 options: none, crop, pad
pad_colorSTRING#000000
imageoptIMAGE
image2optIMAGE
maskoptMASK

Outputs (6)

NameTypeDescription
widthINT
heightINT
IMAGEIMAGE
IMAGE2IMAGE
MASKMASK
resolution_infoSTRING