Ino Image Resize By Longer Side V1
Resize to a max side, keep the aspect ratio — the 'fit into my batch size' node
- image
- image
Resize is the one image op you never think about until a batch fails because one image is 2048 wide and everything else is 1024. Ino Image Resize By Longer Side V1 solves the common case neatly: you say "the longer side should be this many pixels," and it scales the image so that's true while keeping the aspect ratio. The short side follows along automatically - a landscape and a portrait image both end up at the same "size," just oriented differently.
The description is exactly what it does: "Resizes an image so the longer side matches the specified size, preserving aspect ratio." It's the version-1, keep-it-simple resize in a pack that also ships a resize-and-crop variant; this one never cuts pixels, it only scales.
How it works
It looks at the image's height and width. If height ≥ width, the new height becomes your size and the width scales proportionally; otherwise the width becomes size and height follows. Then it resizes with your chosen interpolation mode and antialiasing on. The math is exact for the longer side and rounded for the other - you won't always land on a clean multiple of 8, which matters if the result goes straight into a sampler that wants a divisible resolution. If that's your use, round the output or feed it through a resolution-pad node.
The inputs that matter
- image - the IMAGE tensor to resize.
- size - the target length for the longer side, default 512. The number you'll actually set.
- interpolation_mode -
bicubic,bilinear,nearest, ornearest exact. Bicubic is the safe default for photos; nearest is for pixel-art where you want crisp edges rather than smeared ones.
Output: image - the resized IMAGE tensor, same shape as the input except dimensions.
Where it wires in
Classic spots: normalizing input images before a batch (so every image in a batch tensor has a compatible resolution), downscaling before VAE encode or before a ControlNet preprocessor, and capping sizes before an upscale chain so you don't feed a 4K image into a node expecting a ~1MP input. The KB's upscaling guidance is worth repeating here: for detail recovery you often want to resize down first so a generative upscaler has a clean base - this node is the downsize step.
Installing it
Part of ComfyUI-InoNodes. ComfyUI Manager → search "ComfyUI Ino Nodes" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/nobandegani/ComfyUI-InoNodes
cd comfyui_ino_nodes
pip install -r requirements.txt
Restart after. No keys, no model downloads - the resize runs on torch tensors, and torch ships with ComfyUI.
Common issues
Two gotchas. First, because the short side is a rounded proportion, the output resolution can be an odd number like 512x738 - fine for display, annoying for samplers that want multiples of 8. Second, this node doesn't crop or pad, so images of wildly different aspect ratios will not come out the same shape - if you need identical W×H output, that's what InoResizeCropImage (or a resize-and-crop variant) is for. Keep the two straight: this one preserves everything, the crop one guarantees the box.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size | INT | 5120–99999 | — |
| interpolation_mode | COMBO | 4 options: bicubic, bilinear, nearest, nearest exact |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |