Wan 2.2 Aspect Ratio Helper
The Wan 2.2 size calculator that reads your reference image
- image
- width
- height
- info_text
Wan 2.2 is picky about resolution. Feed it a random width and height and you'll get artifacts, letterboxing, or a model that quietly ignores your framing - it wants dimensions divisible by 8, within a 1:3 to 3:1 aspect ratio, and ideally close to the sizes it was actually trained on. Getting that right by hand means doing the math every single time you swap a reference image. Wan 2.2 Aspect Ratio Helper does the math for you.
This node from the AAA Metadata System pack is the i2v-friendly one of the two Wan size helpers. You feed it an image - the reference frame you're going to animate - and it reads that image's aspect ratio, then produces matching dimensions at the size scale you pick. No manual calculation, no mismatched framing between your first frame and your generation.
How it works
It takes the input image tensor and reads its actual pixel dimensions, computes the aspect ratio, and clamps it to Wan 2.2's supported range if the image is extremely tall or wide (it warns you in the console when it has to). Then it runs a "smart hybrid" algorithm:
- It checks the input ratio against the known Wan 2.2 training sizes it has baked in (the documented resolution table, from square 720×720 up to the wide and ultra-wide variants).
- If your ratio matches a known size, it uses that - models behave best at sizes they've seen.
- Otherwise it computes the closest optimal size that's divisible by 8 and hits the target pixel budget.
The size_preset dropdown - tiny (~200K pixels) through small, medium, large, extra-large and gigantic (~2M pixels) - picks the budget. The nice touch: you can change the preset on the dropdown without rewiring anything, since the outputs are just the width and height for whichever preset is selected.
Outputs
widthandheight- integers, wired into your Empty Latent / Wan size input.info_text- a string showing all six size options for your ratio, so you can see what you'd get if you switched presets.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/AAA_Metadata_System.git
cd AAA_Metadata_System
pip install -r requirements.txt
Restart ComfyUI, or install "AAA Metadata System" via ComfyUI Manager. No model downloads. The pack is CC BY-NC for non-commercial use; commercial use needs a paid license from the author.
Common issues
- Resolution still rejected downstream - check the
info_text; if your preset lands on an odd-looking size, remember the node guarantees divisibility by 8 and a 1:3–3:1 ratio, which is exactly what Wan 2.2 wants. The rejection is usually a different node further down (like an upscaler that re-frames). - Output seems small -
mediumis ~650K pixels, which is the sensible default for 720p-ish video. If you want cinematic detail, move tolargeorextra-large, not by dragging width/height manually. - Extreme input ratios - a 9:21 phone screenshot gets clamped to 1:3. The clamp is intentional; Wan doesn't train beyond that, and fighting it wastes VRAM.
Wan video generation is slow and expensive, so a wrong-sized run stings more than a wrong-sized image. This node is the "check your math before you commit 25 minutes" step, and it's one of the few size helpers that actually knows Wan 2.2's training sizes instead of just dividing.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size_preset | COMBO | medium | 6 options: tiny, small, medium, large, extra-large, gigantic |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| info_text | STRING | — |