ComfyUI Node
Image Resize
Resizes the image (and mask) to width x height. The mask follows the image; without a mask, a padded image returns the padding as the mask (1 = padding). An image already at the output size is passed through untouched.
Image Resize
- image
- mask
- IMAGE
- width
- height
- mask
◄width512►
◄height512►
◄upscale_method▾►
◄keep_proportionstretch►
◄pad_color0, 0, 0►
◄crop_positioncenter►
◄divisible_by2►
◄device▾►
CategoryBCNodes/image
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| width | INT | 5120–16384 | 0 = the source width (or free, when the proportion is kept). |
| height | INT | 5120–16384 | 0 = the source height (or free, when the proportion is kept). |
| upscale_method | COMBO | lanczos runs on the CPU (PIL, 8-bit); nvidia_rtx_vsr needs the nvidia-vfx package and an NVIDIA RTX GPU and rounds the size to a multiple of 8. | |
| keep_proportion | COMBO | stretch | stretch: exactly width x height. resize: the largest size inside width x height at the source aspect. pad / pad_edge / pad_edge_pixel / pillarbox_blur: resize, then pad out to width x height with pad_color / the edge mean / the edge pixels / a blurred cover of the frame. crop: crop to the target aspect, then resize. total_pixels: width x height pixels at the source aspect. |
| pad_color | STRING | 0, 0, 0 | Padding colour for pad: 'r, g, b' in 0-255 or 0-1, #rrggbb, a colour name or one grey value. |
| crop_position | COMBO | center | Where the crop window sits (crop), or where the image sits inside the padding (pad modes). |
| divisible_by | INT | 20–512 | Floor both sides to a multiple of this; padding grows to the next multiple instead. 0 or 1 = off. |
| maskopt | MASK | — | |
| deviceopt | COMBO | Device the frames are processed on (not for lanczos). |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| width | INT | — |
| height | INT | — |
| mask | MASK | — |