Nodes/Image Misc/Resize Image (KJ/SET)
ComfyUI Node

Resize Image (KJ/SET)

Resizes the image to the specified width and height. Size can be retrieved from the input (when w=h=0) or a reference image. Keep proportions keeps the aspect ratio of the image, by highest dimension.

By set-soft·Created about a year ago·Updated 7 months ago· 2
Resize Image (KJ/SET)
  • image
  • mask
  • get_image_size
  • IMAGE
  • width
  • height
  • mask
width512
height512
upscale_methodbicubic
keep_proportionstretch
pad_color#000000
crop_positioncenter
divisible_by2
device
per_batch0
pad_transparency1.0
Categoryimage/manipulation

Inputs (13)

NameTypeDefaultDescription
imageIMAGEImage to resize
widthINT5120–16384Used when no `get_image_size` is provided
heightINT5120–16384Used when no `get_image_size` is provided
upscale_methodCOMBObicubicInterpolation method for image resize
keep_proportionCOMBOstretch`stretch` doesn't keep the aspect ratio `pad` adds `pad_color` bars `pad_edge` fills using the edge color `resize` always keeps aspect, so W and H might change `crop` takes a portion of the image
pad_colorSTRING#000000Color for fill. Can be an hexadecimal (#RRGGBB). Can comma separated RGB values in [0-255] or [0-1.0] range.
crop_positionCOMBOcenterAlso used for `pad`
divisible_byINT20–512Force the final size to be divisible by
maskoptMASKOptional mask for the image will be resized
deviceoptCOMBO2 options: cpu, gpu
get_image_sizeoptIMAGEImage size to use as reference
per_batchoptINT00–16384Process images in sub-batches to reduce memory usage. 0 disables sub-batching.
pad_transparencyoptFLOAT1.00–1The transparency for the padded area for all modes except `edge_pixel`.1.0 is fully transparent, 0.0 is fully opaque.

Outputs (4)

NameTypeDescription
IMAGEIMAGE
widthINT
heightINT
maskMASK