Image Resize (Arctenox's Essentials)
Resize Images Four Ways — and Know the Actual Output Size
- image
- image
- width
- height
Resizing in ComfyUI always comes with a hidden decision: do you want the image stretched to an exact size, or preserved in aspect ratio and letterboxed, or cropped to cover? This node makes you pick, explicitly, from four modes - and then reports back the real pixel dimensions it produced, which is the part other resize nodes often keep from you.
The four modes
- stretch - exact target width × height, aspect ratio be damned. The image distorts if the target doesn't match.
- fit - scale to fit inside the target box, keeping aspect. Result may be smaller than the target on one axis (letterbox/pillarbox territory).
- fill - scale to cover the target box, keeping aspect, then center-crop the excess. No distortion, no empty bars - but edges get cut.
- pad - like fit, then center the result on a black canvas padded to the exact target size.
The practical difference between fit and fill is the one people always get backwards: fit shows you everything (with bars), fill fills the frame (with a crop). Pick fit when losing pixels is worse than having bars; pick fill when you want a clean, full-bleed output.
Inputs and outputs
Inputs: image, width (default 1024, 8–8192), height (same), mode, and interpolation - bilinear, bicubic, nearest, or lanczos. One thing to know about the last one: in this pack, "lanczos" is implemented as bicubic under the hood, so don't expect a dramatic sharpening difference between the two. For downscaling, lanczos/bicubic are the sharpest of the bunch; nearest is for pixel-art or when you want to avoid any averaging.
Outputs: image (the resized tensor), plus width and height as INTs - and here's the value: in fit mode the actual output size almost never equals your target numbers, and this node hands you the truth so you can wire the real dimensions downstream (into an Empty Latent or a VAE encode) instead of guessing.
Where you'd use it
Upscale-then-refine chains, img2img prep, feeding a fixed-resolution model - anywhere you need an image at a predictable size. In pad mode it's a decent poor-man's approach to feeding non-native aspect ratios into a model that wants a specific box.
Install
Same as the pack - ComfyUI Manager (search Arctenoxs-Essentials_ComfyUI) or:
cd ComfyUI/custom_nodes/
git clone https://github.com/Arctenox/Arctenoxs-Essentials_ComfyUI
then restart. No model downloads, no heavy deps. The README does start with a deprecated notice (the author is folding this into a new pack), and a resize node is common enough that alternatives exist everywhere - but if this pack is already installed, this one is perfectly serviceable, and the real-dimensions INT outputs are genuinely nicer than the bare core resize.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| width | INT | 10248–8192 | Target width in pixels |
| height | INT | 10248–8192 | Target height in pixels |
| mode | COMBO | fit | stretch = exact size, ignore aspect ratio fit = keep aspect, fit within target (may letterbox) fill = keep aspect, cover target (may crop) pad = keep aspect, fit then pad with black to exact size |
| interpolation | COMBO | lanczos | Resampling filter. lanczos/bicubic are sharpest for downscaling. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |