AICU Utils
Small, dependency-free utility nodes used by AICU's ComfyLTS lines and books. Starts with Resize Shortest Side To.
ComfyUI AICU Utils 📐
Small, dependency-free utility nodes used by AICU's ComfyLTS lines and books.
No dependencies beyond torch, which ComfyUI already requires. Nothing here pins a version of numpy, pillow, or anything else.
Nodes
Resize Shortest Side To 📐 (ResizeShortestTo)
Scales an image so its shorter side becomes a given number of pixels, preserving aspect ratio.
| input | |
|---|---|
| image | IMAGE |
| size | target length of the shorter side, in pixels (default 640) |
| method | lanczos / bicubic / bilinear / area / nearest-exact |
| round_to_multiple_of | optional. Round both sides up to a multiple of N (use 8 for VAEs) |
Returns (image, width, height).
Two details worth knowing:
- Downscaling uses antialiasing. Without it, high frequencies alias and thin lines
or text get jagged — which is exactly what someone choosing LANCZOS is trying to avoid.
torch has no lanczos kernel, so
lanczosmaps tobicubicwith antialias, the closest match. Output is clamped to 0..1 because bicubic overshoots. round_to_multiple_ofrounds up, never down. Rounding down would turn a requested 640 into 632 and quietly break whatever comes next.
Why this exists
The SG26 book workflows used ResizeShortestToNode from ComfyUI-LogicUtils — and
nothing else from that package.
LogicUtils 1.7.2 pinned numpy back to 1.26.4. On Colab that added about 109 seconds to startup and produced 18 dependency conflicts (measured 2026-08-26: 108.8s → 0.2s for the affected step). Paying that for one resize is a bad trade.
Forking it was not an option either: the upstream repository declares no license, so there is no grant to redistribute a modified copy. This is a clean-room reimplementation instead.
Install
Via ComfyUI-Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/aicuai/comfyui-aicu-utils
Tests
python3 test_resize.py
Checks that the shorter side actually lands on the requested value, that aspect ratio is preserved, that rounding never goes down, that every interpolation method runs, and that a zero-sized image raises instead of passing silently.
License
Apache License 2.0 — see LICENSE.
Copyright 2026 AICU Japan K.K.