Nodes/ComfyUI-RyuuNoodles/Scale To Multiple Adv. 🐲
ComfyUI Node

Scale To Multiple Adv. 🐲

Scale To Multiple, with separate dials for width and height

By DraconicDragonΒ·Created about a year agoΒ·Updated 2 months agoΒ· 12
Scale To Multiple Adv. 🐲
  • image
  • scaled_image
  • scaled_width
  • scaled_height
β—„multiple64β–Ί
β—„crop_modestretchβ–Ί
β—„resize_modelanczosβ–Ί
β—„rounding_mode_widthnearestβ–Ί
β—„rounding_mode_heightnearestβ–Ί
β—„scale_factor_width1.000β–Ί
β—„scale_factor_height1.000β–Ί
β—„widthβ€”β–Ί
β—„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_width and rounding_mode_height - each dimension gets its own nearest/floor/ceil choice. Floor the height to cap VRAM while nearest-snapping the width, that kind of thing.
  • scale_factor_width and scale_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.

CategoryRyuuNoodles 🐲/Images

Inputs (10)

NameTypeDefaultDescription
multipleINT64Multiple to scale to. Setting to 1 effectively disables this.
crop_modeCOMBOstretchCrop 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_modeCOMBOlanczosResize 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_widthCOMBOnearestRounding 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_heightCOMBOnearestRounding 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_widthFLOAT1.000How much to multiply width by before scaling to multiple.
scale_factor_heightFLOAT1.000How much to multiply height by before scaling to multiple.
imageoptIMAGEImage 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).
widthoptINTOptional width to scale the image to after the multiple scaling. If no image is provided it will still output the scaled number.
heightoptINTOptional height to scale the image to after the multiple scaling. If no image is provided it will still output the scaled number.

Outputs (3)

NameTypeDescription
scaled_imageIMAGEβ€”
scaled_widthINTβ€”
scaled_heightINTβ€”