ImageTransformResizeClip
Fit any image inside a size box without stretching it
- images
- IMAGE
"I need this image to fit inside 1024×1024, but don't squish it, and whatever you do don't make it tiny" - that's a sentence most resize nodes can't handle, because they're built around exact dimensions. Allor's ImageTransformResizeClip is built around a range: you give it max and min bounds and it scales the image uniformly (aspect preserved) so it fits inside the max and isn't smaller than the min. That makes it the node for "normalize this batch to a sane size" and "make sure this fits my canvas" workflows where the exact pixel count doesn't matter.
It's part of the Allor Plugin (Nourepide/ComfyUI-Allor), the pack that keeps RGBA and batches intact through its transform family. Where ImageTransformResizeAbsolute forces exact dimensions, Clip is the one that respects what the image already is.
How it works
The node reads the input's dimensions and computes a uniform scale. Two bounds define the acceptable zone:
max_width/max_height(INT, default 1024 each) - the image is scaled down so it never exceeds either.min_width/min_height(INT, default 0) - the image is scaled up so it never dips below either.
The scale is max(scale_min, scale_max): it picks the single factor that satisfies both the floor and the ceiling, applied to both axes so aspect ratio is preserved. There's a guard in there too - if the min bounds are greater than or equal to the max bounds, the node passes the image through untouched rather than doing something degenerate. So a 2048×1024 image with defaults gets scaled to fit 1024-wide, and a 512×384 image with min_width/min_height set to 768 gets scaled up to meet the floor. Set only the max (leave min at 0) and it's a pure "shrink to fit" downscaler; set only the min and it becomes an upscaler.
Output is an IMAGE at the new size, alpha preserved, batch-friendly - every frame is fit to the same box.
Inputs and outputs
images(IMAGE) - single frame or batch.max_width/max_height(INT, default 1024) - upper bound.min_width/min_height(INT, default 0) - lower bound.method-lanczos,bicubic,hamming,bilinear,box,nearest(lanczos default).
Output: IMAGE, uniformly scaled, no distortion.
Installing it
Same pack, same path: ComfyUI Manager → "Allor Plugin" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
No models needed - pure PIL scaling.
Where people get burned
The trap is the min/max interaction: set min_width above max_width and you've just told the node to both grow and shrink, and it takes the safe exit (passthrough), which looks like the node "not working." Keep min ≤ max and they'll behave. Second, remember this scales uniformly - an ultra-wide image fit to a 1024 box ends up small on the height axis, which is correct but surprises people who expected it to fill the box. If you need the frame filled, crop or pad to the target aspect first, then let Clip size it. And on batches, factor in that lanczos is the expensive method - fine for finals, slower for previews.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| max_width | INT | 1024 | — |
| max_height | INT | 1024 | — |
| min_width | INT | 0 | — |
| min_height | INT | 0 | — |
| method | COMBO | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |