Nodes/ComfyUI-BETA-Cropnodes/WAN Resolution Calculator πŸ“ πŸ…‘πŸ…”πŸ…£πŸ…
ComfyUI Node

WAN Resolution Calculator πŸ“ πŸ…‘πŸ…”πŸ…£πŸ…

Stop doing WAN resolution math in your head

By Burgstall-labsΒ·Created about a year agoΒ·Updated 6 months agoΒ· 8
WAN Resolution Calculator πŸ“ πŸ…‘πŸ…”πŸ…£πŸ…
  • source_image
  • width
  • height
  • frame_count
  • info
β—„frame_count16β–Ί
β—„target_megapixels2.0β–Ί
β—„use_custom_aspect_ratiofalseβ–Ί
β—„aspect_ratio_preset16:9β–Ί
β—„custom_aspect_ratio1.147β–Ί
β—„source_width1024β–Ί
β—„source_height1024β–Ί

Wan video models are picky about resolution in a way that's easy to get wrong by hand. You want 720p-ish output, you type in some numbers, and the sampler either chokes or silently gives you a weird aspect ratio. WAN Resolution Calculator exists to remove that step: you tell it how many megapixels you're willing to pay for, it tells you the exact width and height - plus a pass-through frame count - formatted for a Wan workflow. It's a calculator node, not a model, so it's instant and costs nothing.

When people say "WAN" locally, they mean the open Alibaba family - Wan 2.1 and 2.2 - which are Apache 2.0 and the community default for quality-first local video (per the KB's Wan guide; everything from 2.5 on is API-only, so this is for the open weights and the third-party models built on them). Those models want resolutions in the ballpark of 480p (854Γ—480, ~0.41MP) or 720p (1280Γ—720, ~0.92MP), and power users push 960Γ—544, 1024Γ—576, even 1536Γ—864. So target_megapixels of 1.0–2.0 is the normal dial range.

How it decides the numbers: it computes the height from height = sqrt(megapixels / aspect_ratio), derives width, then snaps both down to multiples of 16. The aspect ratio source follows a strict priority: a connected source_image wins (it reads the actual ratio and the actual frame count, overriding your frame_count input entirely), then source_width/source_height if you typed those, then the aspect_ratio_preset, then custom_aspect_ratio if use_custom_aspect_ratio is on, then 16:9. The presets cover 16:9, 1:1, 4:3, 3:2, 21:9, 9:16, 3:4, 2:3, and 9:21.

Inputs: frame_count, target_megapixels, aspect_ratio_preset, use_custom_aspect_ratio, custom_aspect_ratio, source_width, source_height, and the optional source_image. Outputs: width (INT), height (INT), frame_count (INT), and an info STRING that spells out what it chose and why - feed that into a Show Text node the first time and it'll tell you the aspect source it used, which is the fastest way to figure out why you got the numbers you got.

Install is the pack install: ComfyUI Manager β†’ search "BETA" or "Burgstall" β†’ ComfyUI-BETA-Cropnodes (recently renamed ComfyUI-BETA-Helpernodes). Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Burgstall-labs/ComfyUI-BETA-Cropnodes

restart. No models, no extra deps.

One honest discrepancy worth knowing: the README claims dimensions are rounded to multiples of 64, but the code actually snaps to multiples of 16. For the common Wan workflows on ComfyUI that's fine - 16 is what most native Wan nodes tolerate - but if you're targeting a wrapper that strictly demands 64 (some do, for VAE tiling), double-check the output. And remember the source_image override: connect a reference image and it stops being a pure calculator, because your frame count input gets ignored in favor of the image's batch size. If you expected 81 frames and got 16, that's the override talking.

CategoryBurgstall Enabling The Awesomeness

Inputs (8)

NameTypeDefaultDescription
frame_countINT161–1000β€”
target_megapixelsFLOAT2.00.1–100β€”
use_custom_aspect_ratioBOOLEANfalseβ€”
aspect_ratio_presetCOMBO16:910 options: 16:9, 1:1, 4:3, 3:2, 21:9, 9:16, +4
custom_aspect_ratioFLOAT1.1470.1–10β€”
source_widthINT102464–8192β€”
source_heightINT102464–8192β€”
source_imageoptIMAGEβ€”

Outputs (4)

NameTypeDescription
widthINTβ€”
heightINTβ€”
frame_countINTβ€”
infoSTRINGβ€”