Nodes/ComfyUI-BCNodes/Image Resize
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.

By 0xBeycan·Created 13 days ago·Updated about 12 hours ago· 1
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)

NameTypeDefaultDescription
imageIMAGE—
widthINT5120–163840 = the source width (or free, when the proportion is kept).
heightINT5120–163840 = the source height (or free, when the proportion is kept).
upscale_methodCOMBOlanczos 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_proportionCOMBOstretchstretch: 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_colorSTRING0, 0, 0Padding colour for pad: 'r, g, b' in 0-255 or 0-1, #rrggbb, a colour name or one grey value.
crop_positionCOMBOcenterWhere the crop window sits (crop), or where the image sits inside the padding (pad modes).
divisible_byINT20–512Floor both sides to a multiple of this; padding grows to the next multiple instead. 0 or 1 = off.
maskoptMASK—
deviceoptCOMBODevice the frames are processed on (not for lanczos).

Outputs (4)

NameTypeDescription
IMAGEIMAGE—
widthINT—
heightINT—
maskMASK—