Scale To Multiple Adv. π²
Scale To Multiple, with separate dials for width and height
- image
- scaled_image
- scaled_width
- scaled_height
The regular Scale To Multiple node gives you one rounding mode and one scale factor for both dimensions. That covers 90% of cases. This one is for the other 10% - the times you need width and height handled differently, like snapping a wide video frame to a 16:9 grid while keeping portrait crops on their own multiple. It's the same math, with the training wheels off.
What it does
Everything from the base node carries over: scale an image (and/or integers) to a specified multiple, with crop and resize modes, optional width/height overrides, and the image-less "just give me the numbers" mode. What's added is split control:
rounding_mode_widthandrounding_mode_height- each dimension gets its ownnearest/floor/ceilchoice. Floor the height to cap VRAM while nearest-snapping the width, that kind of thing.scale_factor_widthandscale_factor_height- independent pre-multipliers. If you're doing a 1.5x width pass but keeping height close to native, this is the knob that expresses it.
Those replace the single rounding_mode and scale_factor from the simple version, so the actual list of inputs you'll touch is: multiple, the two rounding modes, the two scale factors, plus image/width/height when you have them.
Why you'd pick this over the simple one
Real talk: for most workflows, the simple version is enough, and that's why it's the default recommendation. You'd step up to Advanced when:
- Your aspect ratio isn't square and you want each side snapped to its own grid.
- You're targeting a video resolution where width and height have different divisibility requirements (common on LTX/Wan pipelines that want specific multiples per axis).
- You're budget-tuning - floor one dimension to keep the total latent size under a ceiling while letting the other breathe.
The crop and resize modes (stretch, center, fill, uniform, uniform fill; lanczos down to bilinear - tensor) are identical to the base node. So the choice between the two is purely "do I need two dials or one."
Outputs
Same three: scaled_image, scaled_width, scaled_height. The width/height outputs remain usable on their own, image or no image.
Installing it
It ships in the RyuuNoodles pack:
cd ComfyUI/custom_nodes
git clone https://github.com/DraconicDragon/ComfyUI-RyuuNoodles
Restart ComfyUI, or install via Manager (search "RyuuNoodles"). No models, no extra dependencies.
Gotchas
Same traps as the simple version, worth repeating once: with image, width, and height all unconnected it raises a ValueError (it needs one source of dimensions), and image-less runs produce the "No Image" placeholder - a black PNG with text, not real output, so don't save it by mistake. Also note this is the same code base, so it shares the console logging behavior; the pack settings can quiet it if it bothers you.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| multiple | INT | 64 | Multiple to scale to. Setting to 1 effectively disables this. |
| crop_mode | COMBO | stretch | Crop mode for the image. 'stretch' will stretch the image to fill the target dimensions. 'center' will center the image in the target dimensions. 'fill' will scale the image to fill the target dimensions while maintaining aspect ratio, cropping if necessary. 'uniform' will scale the image to fit within the target dimensions while maintaining aspect ratio. 'uniform fill' will scale the image to fill the target dimensions while maintaining aspect ratio, adding padding if necessary. |
| resize_mode | COMBO | lanczos | Resize mode for the image. 'bilinear - tensor' is different from normal bilinear, it will use torch.nn.functional.interpolate() to resize the image and look very different from normal bilinear. |
| rounding_mode_width | COMBO | nearest | Rounding mode for width. 'nearest' will round to the nearest multiple of 'multiple' value. 'floor' will round down to the nearest multiple. 'ceil' will round up. |
| rounding_mode_height | COMBO | nearest | Rounding mode for height. 'nearest' will round to the nearest multiple of 'multiple' value. 'floor' will round down to the nearest multiple. 'ceil' will round up. |
| scale_factor_width | FLOAT | 1.000 | How much to multiply width by before scaling to multiple. |
| scale_factor_height | FLOAT | 1.000 | How much to multiply height by before scaling to multiple. |
| imageopt | IMAGE | Image to scale. If not provided, only width and height will be scaled. If either or both of the optional width/height inputs are provided, the resizing will use the given input(s). | |
| widthopt | INT | Optional width to scale the image to after the multiple scaling. If no image is provided it will still output the scaled number. | |
| heightopt | INT | Optional height to scale the image to after the multiple scaling. If no image is provided it will still output the scaled number. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| scaled_image | IMAGE | β |
| scaled_width | INT | β |
| scaled_height | INT | β |