Nodes/ComfyUI Easy Use/Image Scale Down To Size
ComfyUI Node Runs on cloud

Image Scale Down To Size

Shrink an image to a target dimension

By yolain·Created 3 years ago·Updated 8 days ago· 2,633
Image Scale Down To Size
  • images
  • IMAGE
size512
modetrue

Downscaling with a guardrail. You give it a target pixel size and it shrinks the image to hit that number while keeping the aspect ratio - no squashing, no stretching. It's the small, boring node that stops the two classic problems: feeding an oversized image into a stage that chokes on it, and manually computing "if it's 3000 wide, what height keeps the ratio at 1024?" You just say "get it down to 1024" and it does the arithmetic.

Why you'd reach for it

Real cases where an image needs to be smaller and proportional:

  • Taming an uploaded reference. Someone hands you a 4000px photo for img2img or ControlNet. Running the preprocessor at that size is slow and pointless; scale it down to a sane working size first.
  • Fitting a model's comfort zone. Diffusion models have a native resolution they like. Downscale an over-large input to near that before the sampler touches it.
  • Normalizing a mixed set. Push a pile of differently-sized images down to a common maximum so the rest of the pipeline sees consistent dimensions.

The "keep aspect ratio" part is the whole value - this isn't a resize-to-exact-WxH node (that would distort), it's a scale-to-fit that preserves proportions.

The inputs and outputs

  • images (IMAGE) - the image or batch to shrink.
  • size (INT, default 512) - the target dimension in pixels. The image is scaled so it lands at this size along the constrained edge, aspect ratio intact.
  • mode (BOOLEAN, default on) - a toggle for how size is applied - i.e. which edge it constrains. If the result isn't the dimension you expected (you asked for 512 and the other axis came out 512), flip this. It's the "longest edge vs shortest edge" switch.
  • IMAGE (output) - the downscaled image, ready to feed onward.

Installing it

ComfyUI Manager: search ComfyUI Easy Use, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use

then install the requirements (install.bat on Windows, else pip install -r ComfyUI-Easy-Use/requirements.txt) and restart.

Common issues

  • It only scales down. The node is built for shrinking. If your image is already smaller than size, don't expect it to enlarge - for upscaling you want easy hiresFix or a dedicated upscale-model node instead.
  • The wrong axis hit the target. This is what mode is for. If you set size to 512 expecting the width to be 512 and the height came out 512 instead, toggle mode. The two options constrain opposite edges.
  • Slightly off-target dimensions. Because it preserves aspect ratio, the unconstrained edge lands wherever the ratio puts it - it won't be a round number, and it may not be divisible by 8. If a downstream node insists on multiples of 8 (many latent operations do), run a follow-up resize or crop to snap it.
CategoryEasyUse/Image

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
sizeINT5121–16384
modeBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE