Y7 Scale Image By
Scale by a multiplier — and stop landing on resolutions that break your model
- image
- image
- width
- height
ComfyUI already ships an ImageScale node, so a resize node has to justify its existence. Y7 Scale Image By does, with two small additions that turn out to matter: it scales by a multiplier instead of an absolute target, and it snaps the result to a friendly resolution - a multiple of 8, 16, or 64 - so the numbers it hands your model are numbers your model actually likes.
If you've ever hit a "latent shape doesn't match" error or watched an img2img pass silently wobble in size, you know the problem. Most diffusion backbones and VAE paths assume dimensions divide by 8 (SDXL-era) or 16; feed them a 917×651 and you're asking for trouble. This node won't produce that number in the first place.
What it's for
It's a pre-flight utility, not a quality upscaler. Reach for it when you want a predictable, aspect-ratio-preserving resize mid-graph:
- resizing a reference image before an img2img or inpainting pass,
- producing the intermediate size for a hi-res-fix second stage,
- normalizing an input so a downstream upscaler or detail pass gets a clean base.
The important line in the sand: resizing adds no information. Upscale a small image to 2x with Lanczos and you get more pixels, not more detail - that's the classic "more pixels vs more detail" trap from the upscaling world, and no resize node escapes it. This one is for the "more pixels, exactly how I asked" job.
How it works
The source is short and honest. It moves the image to channels-first, computes round(w × scale_by / resolution_steps) × resolution_steps for both axes, then runs ComfyUI's own common_upscale with crop set to disabled - meaning it preserves the full aspect ratio and letterboxes nothing. After a run it stamps the result as W x H right on the node, which is handy when you're eyeballing whether a chain of resizes drifted.
Inputs and outputs that matter
There are only four knobs. The ones you'll actually touch:
- scale_by - the multiplier, 0.01 to 8.0, default 1.0. 0.5 halves, 2.0 doubles. Type
0.01and you can shrink a 4K image to a thumbnail in one step. - resolution_steps - snap the output to a multiple of this, default 8. Set 16 or 64 if your model chain wants stricter alignment. This is the feature the built-in ImageScale node doesn't give you.
- upscale_method -
lanczos(default) is the sensible upscale choice; switch toareawhen you're shrinking, because area averaging handles downsampling far more gracefully than lanczos can.
Outputs are image, plus width and height as INTs - nice when a downstream node wants the dimensions as actual numbers rather than you hardcoding them.
Installing it
This ships inside the ComfyUI-Y7Nodes pack ("Y7Nodes for ComfyUI"). The easy way:
- ComfyUI Manager → Custom Nodes Manager → search Y7Nodes → Install → restart ComfyUI.
Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/yushan777/ComfyUI-Y7Nodes
pip install -r requirements.txt
# restart ComfyUI
One heads-up: that requirements file pulls in transformers, sentencepiece, protobuf, and lmstudio, all of which exist for the pack's heavy LLM nodes (prompt enhancer, Qwen VL, JoyCaption), not for this resize node. Installing the pack drags them in regardless, so don't be startled when a "simple" scale node's install looks like a machine-learning setup. Nothing here needs a model download.
Common issues
The realistic failure mode is expecting too much of it. Scaling by 2.0 to make a soft image sharp will disappoint - that's a job for a real generative upscaler (SeedVR2, SUPIR, or a tiled ESRGAN pass), not an interpolation node. And remember resolution_steps rounds, not floors, so a 1003px input at scale_by = 1.0 with steps of 8 becomes 1000 (or 1008), not 1003. If you genuinely need the exact original size, steps of 1 is the closest you'll get.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| upscale_method | COMBO | lanczos | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
| scale_by | FLOAT | 1.000.01–8 | — |
| resolution_stepsopt | INT | 81–256 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |