AGSoft Image Resize
The tiny resize node that does exactly what you ask, no more
- image
- IMAGE
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- usetarget_widthandtarget_heightas the destination. Whether that's an exact, possibly distorted fit or a proportional one depends onkeep_aspect_ratio.percentage- usepercentage(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 benone,width,height, orboth. This is the genuinely useful bit: it means "only resize if the image is bigger than the target" or "only if it's smaller." Setresize_if_largertobothwith 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, ornearest. 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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resize_mode | COMBO | 2 options: fixed_size, percentage | |
| target_width | INT | 5121–8192 | — |
| target_height | INT | 5121–8192 | — |
| percentage | FLOAT | 100.00.1–1000 | — |
| resize_if_larger | COMBO | 4 options: none, width, height, both | |
| resize_if_smaller | COMBO | 4 options: none, width, height, both | |
| keep_aspect_ratio | BOOLEAN | true | — |
| interpolation | COMBO | 4 options: lanczos, bilinear, bicubic, nearest | |
| crop_if_needed | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |