Resize Image Advanced
The resize node that does everything, including math you didn't know you wanted
- image
- mask
- image
- width
- height
- mask
ComfyUI's core Resize node is fine until it isn't. You want to letterbox into a fixed canvas, crop to a 16:9 target, force every output to a multiple of 64, or keep a mask aligned while you resize - and suddenly you're stacking three nodes and a bunch of math. Resize Image Advanced is the one-node answer, and it's more capable than the KJ-style resizer it's clearly modeled on.
If your workflow lives or dies by hitting exact pixel targets (latent sizes, video model constraints, upscale passes that must divide cleanly), this node quietly removes a whole category of fiddly failures.
How it works
Two resize_modes, and which one you pick changes the whole shape of the node:
explicit- you typewidthandheight. Thefitmode decides what happens when the source aspect doesn't match. Options run fromfill/stretch/crop(distort or cut) throughletterbox/pad(bars in your chosenbackground_color) topillarbox_blur(the blurred-background look video editors love).aspect_ratio- you pick a ratio (1:1,3:2,4:3,16:9,2:3,3:4,9:16,custom, or keeporiginal) and ascale_to_sidetarget: longest side, shortest side, width, height, or total kilo-pixels. This is the "give me a 1024-longest 16:9" workflow in one shot.
round_to_multiple then snaps the result up to a divisor - set 8 or 64 and every frame comes out divisible, which is the old KJ divisible_by behavior. method gives you the resampling pick (nearest, bilinear, area, bicubic, lanczos) plus nvidia_rtx_vsr, which only works if you have the NVIDIA VSR runtime and a compatible GPU - don't pick it hoping for magic on a plain setup. device lets you force cpu or gpu.
The mask part
The genuinely unusual feature: an optional MASK input that gets resized, cropped, or padded in lockstep with the image and comes back out the mask output aligned to the final frame. For mask-guided workflows where a letterbox or crop used to silently desync your mask from the image, this kills the problem at the source.
Inputs and outputs
The three you'll set most: resize_mode, fit, and round_to_multiple. background_color matters whenever you letterbox or pad - it's hex, #000000 default. crop_position decides which edge survives a crop.
Outputs are image, plus width and height (INT) - genuinely useful, since you can wire the actual dimensions into a latent-size node or conditioning and stop guessing - and mask.
Install
Part of ComfyUI Text Processor:
cd ComfyUI/custom_nodes
git clone https://github.com/rookiestar28/ComfyUI_Text_Processor.git
pip install -r requirements.txt
Or via ComfyUI Manager, searching "ComfyUI Text Processor". Restart after either. No extra downloads - nvidia_rtx_vsr is the only optional path, and it needs system-level NVIDIA software, not a pip package.
Gotchas
round_to_multiple rounds up, so a 512×512 source with round_to_multiple=64 stays 512 but a 510-wide target becomes 512 - expect the odd added pixel. And if background_color looks wrong, check you wrote #RRGGBB not a named color. Otherwise, this is the rare utility node that's harder to misuse than the core node it replaces.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image batch to resize. | |
| resize_mode | COMBO | Use width and height directly or calculate a target from aspect-ratio controls. | |
| width | INT | 5120–16384 | Explicit output width; zero preserves the source ratio from height. |
| height | INT | 5120–16384 | Explicit output height; zero preserves the source ratio from width. |
| aspect_ratio | COMBO | Target ratio for aspect_ratio mode; custom uses proportional values. | |
| proportional_width | INT | 11–16384 | Width component used when aspect_ratio is custom. |
| proportional_height | INT | 11–16384 | Height component used when aspect_ratio is custom. |
| fit | COMBO | How source content is stretched, fitted, padded, cropped, or pixel-budgeted. | |
| method | COMBO | Resize algorithm; nvidia_rtx_vsr requires a compatible NVIDIA runtime. | |
| scale_to_side | COMBO | Dimension or total-pixel policy controlled by scale_to_length in aspect_ratio mode. | |
| scale_to_length | INT | 10241–16384 | Target side length, or kilo-pixel budget for total_pixel mode. |
| background_color | STRING | #000000 | Hex fill color used by letterbox and padding fit modes. |
| crop_position | COMBO | Anchor used when crop fitting removes overflow. | |
| round_to_multiple | INT | 00–512 | Round final dimensions to this multiple; zero disables rounding. |
| device | COMBO | Requested processing device; availability depends on the selected method and runtime. | |
| maskopt | MASK | Optional mask transformed with the same geometry as the image. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Resized image batch. |
| width | INT | Final output width. |
| height | INT | Final output height. |
| mask | MASK | Mask aligned to the resized image, or an empty mask when no mask is supplied. |