DY Image Scaler
Resize to a target long side, aspect preserved, no model
- image
- IMAGE
DY Image Scaler is the pack's "just resize it" node, and the thing it does differently from core ComfyUI is that it takes one number, not two. You give it a target size and it scales the image so its longest side lands at that size, keeping the aspect ratio intact. That's it. No upscaler model, no SR magic, no latent space - plain PIL LANCZOS resampling on the pixel tensor.
Why would you reach for it when core ComfyUI already has an UpscaleImage node? Because most of the time when you're resizing mid-workflow, you don't care about exact width and height - you care about "make it big enough to feed the next step" or "shrink it so it fits in the graph." This node encodes that as a single slider: set 1024, and whether your image was portrait, landscape, or square, the long edge comes back at 1024 and the short edge follows proportionally. It's the mental model people actually use, and it saves you from doing the math or a second aspect-ratio node.
A few grounded details from the source. The resize is straight PIL resize() with LANCZOS, the gold-standard default for quality downscales and mild upscales. It works on the IMAGE tensor directly - no VAE encode/decode round-trip, so it's cheap and safe to drop into the middle of a graph. And, consistent with the rest of this pack, it only processes the first image of a batch. If you feed it a batch of 8, you get 1 back. Don't use it for batch work.
The one input
- size (64–8192, default 1024) - the length of the longest side after scaling. Step is 8, which keeps results friendly to the resolutions most models expect, though it happily takes any value.
Install
Part of dymokomi/comfyui_dygen by Dy Mokomi. ComfyUI Manager → search "comfyui_dygen", or:
cd ComfyUI/custom_nodes
git clone https://github.com/dymokomi/comfyui_dygen
Restart. No extra dependencies - it's Pillow and numpy, already in every ComfyUI install.
The honest caveats
- It's a resize, not an upscale. Blowing a 512 image up to 2048 with LANCZOS will be soft; if you want real detail added, that's the job of a proper upscaler (see the KB's upscaling notes) - run this after, or use it to normalize sizes before a tiled upscaler.
- Only the first frame of a batch survives.
- There's no fit-or-crop mode: it always fits the whole image within a
size × sizebox, so an extreme panorama still gets its full width scaled down, not cropped.
It's a small node with a small job, and it's good at it. If you're already installing this pack for the color pipeline, this one's the free convenience rider - worth grabbing when you need a "fit to this size, don't ask questions" step between two nodes.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size | INT | 102464–8192 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |