Nodes/comfyui-AGSoft/AGSoft Image Resize
ComfyUI Node

AGSoft Image Resize

The tiny resize node that does exactly what you ask, no more

By Art-xmaster·Created 12 months ago·Updated about 8 hours ago· 23
AGSoft Image Resize
  • image
  • IMAGE
resize_mode
target_width512
target_height512
percentage100.0
resize_if_larger
resize_if_smaller
keep_aspect_ratiotrue
interpolation
crop_if_neededfalse

This is the plainest resize node in the AGSoft pack - no mask handling, no megapixel modes, no fit strategies beyond the one toggle. Just an image in, a size decision, an image out. In a pack that's otherwise packing every resize variant it could think of, AGSoft Image Resize is the baseline the fancier nodes build on. And sometimes the baseline is exactly what you want.

What it does

The resize_mode dropdown has two entries:

  • fixed_size - use target_width and target_height as the destination. Whether that's an exact, possibly distorted fit or a proportional one depends on keep_aspect_ratio.
  • percentage - use percentage (100 = original, 50 = half, 200 = double). No arithmetic required for the common "make this half size" case.

The rest of the inputs are the conditions that decide whether a resize happens at all:

  • resize_if_larger / resize_if_smaller - each can be none, width, height, or both. This is the genuinely useful bit: it means "only resize if the image is bigger than the target" or "only if it's smaller." Set resize_if_larger to both with a 1024 target and huge uploads get shrunk while small images pass through untouched - a one-line guardrail for batch pipelines that would otherwise upscale your tiny inputs by mistake.
  • keep_aspect_ratio - keep proportions (default). Turn it off and it stretches to the exact box.
  • crop_if_needed - when keeping aspect ratio and the target ratio doesn't match, this crops the overflow instead of letterboxing. Without it, you get the "fits inside, but not exactly" result.
  • interpolation - lanczos, bilinear, bicubic, or nearest. Lanczos for quality, nearest when you're resizing pixel art or masks and don't want smoothing.

Output: a single image (IMAGE). No dimensions out, no mask out - which is the whole character of this node.

Installation

From comfyui-AGSoft:

cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft.git
# restart ComfyUI

Or ComfyUI Manager → search "comfyui-AGSoft". Standard numpy/opencv deps, no models.

Where it fits

Reach for this one when you want a resize node that doesn't surprise you. The conditional resize_if_larger/resize_if_smaller guards genuinely earn their place in a batch or upscale pipeline. But if you need the output dimensions handed back, a mask resized in lockstep, or sizing by megapixels, you're looking for the pack's bigger siblings - AGSoft Image & Mask Resize Base is the generalist, and Advanced is the mask-registration workhorse. This one is the lightweight: quick, predictable, and done.

CategoryAGSoft/Image

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
resize_modeCOMBO2 options: fixed_size, percentage
target_widthINT5121–8192
target_heightINT5121–8192
percentageFLOAT100.00.1–1000
resize_if_largerCOMBO4 options: none, width, height, both
resize_if_smallerCOMBO4 options: none, width, height, both
keep_aspect_ratioBOOLEANtrue
interpolationCOMBO4 options: lanczos, bilinear, bicubic, nearest
crop_if_neededBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE