Resize Shortest To
Scale an image by its shortest side, aspect ratio intact
- image
- IMAGE
A lot of resize nodes make you pick a target width and height and then either fight aspect ratio distortion or crop something off. Resize Shortest To sidesteps that: you give it one number, and it scales the whole image so the shorter side lands on that number, with the longer side scaling proportionally to match. A 1600×900 image resized to 512 becomes roughly 910×512 - the aspect ratio never changes, only the overall scale.
This is the standard move before feeding an image into anything that has a minimum-dimension expectation but doesn't care about the exact aspect ratio - a preprocessor, a reference image for a ControlNet, an upscale pass that wants a known floor to work from. "Shortest side to N" is also the same convention a lot of vision models and preprocessing pipelines use internally, so reaching for this node before handing an image off to one of those is usually the right instinct rather than an arbitrary choice.
How it works
It reads the image's width and height, figures out which side is shorter, computes the scale factor needed to bring that side to size, and applies the same scale factor to both dimensions using the resampling filter you pick with method. No cropping, no padding - just a proportional resize.
The inputs and outputs that matter
- image - the IMAGE to resize. Required.
- size - the target length for the shorter side, default 512. This is the one number you're actually setting.
- method - the resampling filter:
NEAREST,LANCZOS, orBICUBIC. LANCZOS and BICUBIC give smoother results and are the usual picks for photographic content; NEAREST is faster and preserves hard edges (useful for pixel art or masks where you don't want interpolation blur). - Output - IMAGE, resized, same aspect ratio as the input.
How to install it
Ships with the full LogicUtils pack. Via ComfyUI Manager: search ComfyUI-LogicUtils, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
then restart ComfyUI. No models to download - resizing here is handled with standard image libraries already present in a ComfyUI install, so there's nothing extra to fetch.
Background on the pack: it's written by aria1th, publicly known as AngelBottomless, the trainer behind Illustrious XL - the SDXL anime finetune that displaced Pony Diffusion v6 as the open-source default. LogicUtils is his side project, and the README is upfront about the docs: "Proper documentation is being prepared, however there are too many nodes." That's held since the repo's last push in early 2026. It's a real, used pack - it turns up as a dependency in complex published workflows next to rgthree-comfy and comfyui-kjnodes - it just relies on the node name and its defaults to explain itself, which is what this article is doing.
Common issues & troubleshooting
Output is bigger than you expected. "Shortest side to size" means the longer side ends up larger than size, sometimes substantially so on a wide or tall source image. If you actually wanted a fixed maximum dimension, you want the "longest side" version of this idea, which isn't what this particular node does.
Result looks soft or blurry. That's the resampling filter - LANCZOS and BICUBIC both smooth as part of scaling, which is usually what you want for photos but can soften fine detail or pixel-art edges. Switch method to NEAREST if you need hard edges preserved.
Downstream node rejects the size. Some samplers and models want dimensions divisible by 8 or 64. This node doesn't round to any multiple - it's a pure proportional resize - so if the target dimension it lands on isn't a clean multiple, you may need a rounding step afterward.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size | INT | 512 | — |
| method | COMBO | 3 options: NEAREST, LANCZOS, BICUBIC |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |