Emiewn Nearest I2V Res
The Wan 2.2 I2V resolution bucket finder you didn't know you needed
- image
- width
- height
Wan 2.2 I2V has a dirty little secret: it wasn't trained on arbitrary resolutions. It expects your image to land in one of a small set of aspect-ratio buckets - roughly fourteen shapes like 832x480, 480x832, 608x640 - all built around a ~640px base. Feed it a random size and motion quality and temporal stability quietly get worse. Emiewn Nearest I2V Res exists to answer one question: which bucket is my image closest to? It hands you two integers, and you use them to resize before the I2V sampler.
This isn't a made-up workflow, either. "Wan 2.2 has aspect ratios that it works well with, such as 832x480," is a recurring r/StableDiffusion question, and the standard answer is to prep your image to a target resolution before generating. This node automates the "which one" part.
How it works
The node has a hardcoded list of the fourteen Wan 2.2 buckets (portrait and landscape versions of the same shapes, 416x960 through 960x416). For your input image it computes the bucket whose aspect ratio is closest to the image's, minimizing the difference in proportional dimensions. Then it scales that bucket to your base_resolution and rounds to a multiple of 16, so the final size is something the model's VAE can chew on cleanly.
A square image resolves to one of the near-square buckets (608x640 or so); a 16:9 image lands on 832x480-ish. It preserves your aspect ratio rather than cropping to fill, so the image gets fit into the bucket.
Inputs and outputs
image(IMAGE) - the image you plan to animate. It just reads the dimensions; it doesn't resize anything itself.base_resolution(integer, 64–2048, default 640) - the pixel base the buckets are built around. 640 is the Wan 2.2 default and you should leave it there unless you know why you're changing it. Dialing it to 832 or 1280 scales every bucket up accordingly.
Outputs are width and height as plain integers. Wire them into an image-resize or latent-resize node (or an aspect-ratio pack) that sits between your input image and the I2V sampler.
Installing it
It's one of five nodes in the Emiewn pack, so install the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/emiewnn/ComfyUI-Emiewn-Nodes.git
Restart ComfyUI, or search "ComfyUI-Emiewn-Nodes" in ComfyUI Manager. This node has no model downloads and no special dependencies - it's a pure function of your image's dimensions.
Gotchas
- The little "I2V Bucket Resolver" badge on the node is decorative. It does nothing; it's just a label the extension draws.
- It only outputs numbers. If you expected the node to also resize the image for you, it doesn't - you still need a resize node between this and the sampler, or the ints go nowhere.
- The default 640 base is the right call for Wan 2.2. Crank it higher and you're just multiplying compute, not quality.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image to find nearest I2V bucket size for | |
| base_resolution | INT | 64064–2048 | Target base resolution (default 640 for WAN 2.2) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |