Image Scale Down
Pin an image to an exact size the lazy (and correct) way
- images
- IMAGE
Image Scale Down (imageScaleDown) from the zsq_prompt pack does one job and does it simply: resize an image to an exact width × height, no matter what aspect ratio it started with. If you've ever fed a 1216×832 render into a node that demands exactly 512×512 and watched it come out squished, this is the node that fixes that - because the crop option handles the aspect mismatch for you.
How it works
The core operation is a plain PIL resize to your target dimensions using Lanczos, which is a solid, sharp choice for downscaling. The interesting part is the crop toggle:
- disabled - just stretches to the exact size. Fast, but if the aspect ratios differ, things get squished. Fine for placeholders, bad for faces.
- center - first center-crops the image to the target aspect ratio, then resizes. You lose the edges instead of the proportions. This is almost always what you want.
It works on whole batches too - every frame in the input tensor gets the same treatment.
Inputs and outputs that matter
- images - the IMAGE batch to scale down.
- width / height - target dimensions (1 to 16384, step 1). 512×512 is the default, which makes this node the natural gateway for SD 1.5-style img2img.
- crop -
disabledorcenter. Set tocenterunless you genuinely want the squish. - Output: IMAGE, same batch count as the input, at exactly the size you asked for.
Where it fits
This is the "get a big image down to a workable base" node. Classic moves:
- Downscale a 4K render to 512/768/1024 before an img2img or ControlNet pass - most models want input near their native resolution, and this node is the fast, deterministic way to get there.
- Shrink a reference image before feeding a tiler, saving VRAM on huge canvases.
- Standardize mixed-size batches so downstream nodes stop complaining about mismatched tensors.
For "scale by a factor instead of to an exact size," the pack's imageScaleDownBy is the sibling - it calls this same node with a computed size and center crop built in.
Installing zsq_prompt
Shared pack install. ComfyUI Manager → search zsq_prompt → install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/windfancy/zsq_prompt
Restart ComfyUI. Be ready for a heavy dependency pull (transformers, opencv-python, opencv-contrib-python, scikit-image, timm, onnx, ultralytics) - it's one shared requirements.txt for the whole pack, and this node only needs PIL/torch. If Manager reports "conflicting with zsq_prompt" on a workflow you load, that's dependency-overlap noise, only meaningful once the pack is actually installed. No model downloads needed.
Gotchas
- With
cropdisabled and a mismatched aspect, you will get distortion. The node won't warn you. - It's a pixel downscale, not a generative one - it shrinks existing pixels, it can't invent detail if you later upscale back.
- Step is 1 on the dimensions, so you can land on odd sizes; if a sampler downstream is picky about multiples of 8, pick your sizes accordingly.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| width | INT | 5121–16384 | — |
| height | INT | 5121–16384 | — |
| crop | COMBO | 2 options: disabled, center |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |