Resize To Multiple
When the model complains your dimensions aren't a multiple of 8 (or 64, or 112)
- image
- image
- width
- height
Resize To Multiple is the "shut up, dimensions" node - the one you reach for the moment a model or a VAE decides your image size is wrong. It snaps an image's width and height to the nearest multiple of a number you pick (default 32), so a 1003×1003 image becomes 992×992, or a 2000×1537 becomes a clean multiple of whatever you set.
The reason this node exists is that image models are not indifferent to dimension. Latent space works in multiples of 8, Flux explicitly wants dimensions divisible by 64, and several modern edit models want multiples of 112 (the crop-and-stitch crowd learned that one the hard way). Feed a model an off-multiple size and you get errors, or worse, silent artifacts. This node is the cheap, deterministic fix: no model, no guesswork, just arithmetic you didn't want to do manually.
How it works
Simple math: target width = (width // multiple) * multiple, same for height - it rounds down to the nearest multiple. Then method decides how to get there:
- crop (the default) center-crops the image to the target, trimming the few leftover pixels evenly from the edges.
- stretch resizes with Lanczos to the target dimensions, distorting the image slightly if the aspect doesn't line up.
There's a guard for the degenerate case: if a dimension would round down to zero (a 20px image with multiple=32), it forces that side up to one full multiple so you never get a zero-size image.
Outputs are image, width, and height as integers - the latter two handy if you're logging or computing against the result.
The trade you should actually think about
Crop loses pixels; stretch loses proportions. The default is crop, which is usually right - trimming 8px off a 1024×1032 image loses nothing anyone will see. But if you're working with a composition where edges matter (text, faces near the frame), those few trimmed pixels are real content. And if you picked stretch, you're trading a subtle distortion for keeping everything. Neither is wrong; just know the default quietly throws away edges.
Two limits worth naming: it only rounds down, so it will never grow an image to hit a multiple - if you need to round up (crop, then upscale to the multiple), that's a different node or a resize before this one. And it doesn't upscale small images; an image smaller than the multiple stays small, just snapped. Its job is alignment, not enlargement.
When you'll actually use it
- Before feeding a Flux or Qwen-family model that demands 64- or 112-divisible dimensions.
- Before a VAE encode/decode when you keep getting dimension errors.
- Before tiling or compositing, where aligned grid dimensions make the rest of the graph behave.
- After a crop node that left you with an odd size, to clean up before it hits anything picky.
It's the quiet workhorse of the pack - nobody builds a workflow around it, but it gets dropped in front of picky nodes constantly. For a three-input node with a single job, that's a good life.
Install
Same as every node in this pack: ComfyUI Manager (search "ComfyUI-Image-Resizing") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Zar4X/ComfyUI-Image-Resizing
Restart, and it's under Image Resizing/Resize. No models, no downloads - just the standard torch/Pillow/numpy/OpenCV dependencies you already have installed.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| multiple | INT | 321–1024 | — |
| method | COMBO | crop | 2 options: stretch, crop |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |