Light-Tool: Resize Image By Ratio
Scale an image by a multiplier — like zooming a photo
- image
- image
Light-Tool: ResizeImageByRatio is the simplest of the pack's resize nodes: multiply both dimensions by a single ratio and you're done. 0.5 halves the image, 2.0 doubles it, 1.0 is a no-op. It's the "zoom" node - you think in terms of "make it half the size" or "80% of this," not "make it exactly 1024 wide."
That's genuinely useful in a way that's easy to underestimate. Aspect-ratio-preserving, both dimensions scaled by the same factor, no box to reason about. When you want "a bit smaller" or "a bit bigger" rather than a precise target, this is the least-fiddly option in the pack.
How it works
For each image in the batch it reads the original dimensions, multiplies both by ratio, and resizes with your chosen method:
new_width = int(original_width * ratio)
new_height = int(original_height * ratio)
The fractional result gets truncated to whole pixels, which is unavoidable and mostly invisible. Interpolation defaults to LANCZOS - the right call for downscaling, and a perfectly good one for moderate upscaling, though if you're doing a serious 2x+ enlargement you should be reaching for a real upscale model, not this. The mode input (default RGB) picks the color space; set RGBA if your image carries transparency and you want it to survive the trip.
Inputs and output
- image - the IMAGE tensor.
- ratio - a FLOAT, default
0.5. Below 1 shrinks, above 1 grows. Note there's no max, so nothing stops you from typing10.0- just don't expect the results to be crisp. - resize_method, mode - as above.
One image out, batch size preserved.
The honest comparison
The pack gives you four resize flavors, and they don't overlap as much as they look like they do:
- ResizeImageV2 - "make one side exactly this, keep the ratio." For precise targets.
- ResizeImageByRatio - "scale by a multiplier." For "half size" or "10% bigger."
- ResizeImageByMaxSize - "shrink to fit inside this box." For unknown input sizes.
- ResizeImage - exact width and height, ratio be damned.
If you want a workflow that downsizes a preview to 50% or steps through a series of scales - say, feeding a detail-control node progressively smaller versions of a reference - ByRatio is the one where the intent stays readable. Wire the ratio to a widget or another node and you can animate the scale without touching dimensions.
Gotchas
The only real trap is expecting quality from large upscales - this is a geometric resize, not an AI upscale, and pushing ratio above 1.5 or so gets soft fast. And since the output keeps the same aspect ratio, there's no cropping and no padding here; if you need a specific ratio with padding, that's the pack's Ratio Padder (AspectRatioPadder), not this node.
Install as usual: ComfyUI Manager → search ComfyUI-Light-Tool, or clone and pip install -r requirements.txt from custom_nodes, then restart. No models needed.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| ratio | FLOAT | 0.50 | — |
| resize_method | COMBO | LANCZOS | 4 options: LANCZOS, BICUBIC, NEAREST, BILINEAR |
| mode | COMBO | RGB | 3 options: RGB, RGBA, L |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |