Nodes/ComfyUI-Info-Prompt-Toolkit/Scale (width x height)
ComfyUI Node

Scale (width x height)

Scale a resolution and keep it cleanly divisible — no more broken latents

By kinorax·Created 5 months ago·Updated about a month ago· 2
Scale (width x height)
  • size
  • width x height
  • width
  • height
scale_by1.00
min_unit32
actual_ratio

If you've ever typed a width and height into an Empty Latent, queued the run, and watched it error because the numbers weren't divisible by 8 - or worse, silently produce tiles with seams - you know why a node like this exists. Scale (width x height) takes an IPT-Size value, scales it by a factor, and snaps the result to a clean multiple of your chosen min_unit, so whatever comes out divides evenly.

It's part of this pack's "size as a first-class value" system: sizes travel as IPT-Size bundles (the "width x height" type), get computed by nodes like Aspect Ratio to Size, and flow into Empty Latent and samplers as a single wire. This node is the arithmetic step in that flow - take a computed size, multiply it up or down, keep it valid.

How it works

The inputs are about as short as they get:

  • size (default 512×512) - the width x height input you're scaling. Range is 16–16384 per side.
  • scale_by (default 1.0, 0.01–64) - the multiplier. 0.5 halves, 2.0 doubles. This is the knob you'll actually touch.
  • min_unit (default 32, options 8/16/32/64) - the step the result snaps to. A size that isn't a multiple of this gets rounded to the nearest multiple. 8 is the classic "will always VAE-decode cleanly" floor; 32 is the pack's pragmatic default for SDXL-era resolutions and tiled work.
  • actual_ratio - display-only. It's a readout of the resulting aspect ratio, so you can check you didn't accidentally distort the frame while scaling. There's a small UI update that feeds this text back into the widget as you edit.

Outputs: width x height (the new IPT-Size bundle - this is what you wire onward), plus individual width and height integers for any node that wants the numbers loose.

One nice property: because scaling preserves the input ratio and then snaps, a 512×512 at 1.5× becomes 768×768, and a 1024×576 at 2× becomes 2048×1152 - the ratio stays intact and everything stays divisible.

Why the snapping matters

Sampling on awkward resolutions is where the subtle artifacts live. Latents are 8× downsampled, so a size that isn't a multiple of 8 means the VAE gets a shape it has to pad or crop, and the seams and edge artifacts you get back are the price. Tiled workflows make it worse - a tile grid on a non-divisible canvas leaves ragged edges. Snapping to 8/16/32/64 is cheap insurance, and it's exactly the kind of thing you stop thinking about once the node does it for you.

Install

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt

Or ComfyUI Manager → search "ComfyUI-Info-Prompt-Toolkit" → install → restart. Nothing extra needed.

Where people get burned

The two usual suspects: forgetting that scale_by applies to both dimensions (so 2.0 is a 4× pixel increase, and VRAM goes up accordingly - scale 1024×1024 by 2 and you're sampling 2048×2048), and expecting min_unit to round up. It rounds to nearest, so a 513 at min_unit 8 becomes 512, not 520. If you specifically need a size that's a multiple and don't care about exact ratio preservation, the pack's Aspect Ratio to Size family is the better tool; this node is for pure proportional scaling.

CategoryInfo-Prompt-Toolkit/ImageInfo

Inputs (4)

NameTypeDefaultDescription
sizeIPT-Size[object Object]16–16384
scale_byFLOAT1.000.01–64Scale factor
min_unitCOMBO32Minimum size step
actual_ratioSTRINGDisplay only

Outputs (3)

NameTypeDescription
width x heightIPT-Size
widthINT
heightINT