Nodes/ComfyUI-LogicUtils/Resize Image With Resolution If Bigger
ComfyUI Node

Resize Image With Resolution If Bigger

Downscale-only, skip if already small

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Resize Image With Resolution If Bigger
  • image
  • IMAGE
resolution512
method

The ceiling node. It resizes an image only if it's larger than the target resolution, shrinking it down to fit - and if the image is already at or below that size, it passes through untouched. Think of it as "cap the size, but don't blow up small images to meet it."

This is the one you reach for when you're guarding against oversized inputs. Someone loads a 4096×4096 monster into a workflow that only needs 1024, and without a cap your VAE encode, ControlNet pass, or upscaler grinds for ages or runs out of VRAM. Drop this in and anything over your limit gets brought down, while the images that were already reasonable are left exactly as they are.

How it works

It compares the incoming image to your resolution target. Bigger? It scales it down proportionally (aspect ratio preserved) until it fits. At or below the target? Straight passthrough, no interpolation applied. Because it only ever shrinks, it never softens a small image by needlessly stretching it - which is the whole point of the conditional.

Downscaling is the resize direction that interpolation actually does well, so with LANCZOS the shrunk results stay crisp. No detail is invented and none needs to be; you're throwing pixels away, not making them up.

The inputs that matter

  • resolution (default 512) - the ceiling. Images above it shrink to fit; images below pass through.
  • method - LANCZOS, BICUBIC, or NEAREST. Use LANCZOS for the sharpest downscale of real images; NEAREST only for masks or pixel art.

image in, one IMAGE out - shrunk only if it was too big.

The pair it belongs to

Its mirror is ResizeImageResolutionIfSmaller, which enforces a floor instead of a ceiling - it only upscales images that are too small. Use the two together and you clamp a whole batch into a size band: floor with the "if smaller" node, ceiling with this one. That's a clean way to normalize wildly mixed inputs without distorting anything or wasting work on images that were already in range.

Installing ComfyUI-LogicUtils

ComfyUI Manager: Install Custom Nodes → search "ComfyUI-LogicUtils" → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils

Restart ComfyUI. No dependencies.

Worth knowing

The pack comes from aria1th (AngelBottomless), the Illustrious XL trainer, as an undocumented personal toolkit - and a downscale-if-too-big node is exactly the kind of practical guard you build after processing enough oversized images to know they'll wreck a batch. The behavior is literal: resize if bigger, otherwise leave it alone.

Categoryimage

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
resolutionINT512
methodCOMBO3 options: NEAREST, LANCZOS, BICUBIC

Outputs (1)

NameTypeDescription
IMAGEIMAGE