Nodes/comfyui-timesaver/TS Image Resize
ComfyUI Node

TS Image Resize

Resize by exact size, one side, megapixels or scale, with divisor snapping and an optional no-enlarge guard.

By AlexYez·Created 2 years ago·Updated 3 days ago· 11
TS Image Resize
  • pixels
  • mask
  • IMAGE
  • width
  • height
  • MASK
target_width0
target_height0
smaller_side0
larger_side0
scale_factor0.0
keep_proportiontrue
upscale_methodbicubic
divisible_by1
megapixels1.00
dont_enlargefalse
CategoryTS/Image/Size

Inputs (12)

NameTypeDefaultDescription
pixelsIMAGEImage to resize.
target_widthINT00–8192Exact target width in pixels. 0 = ignore this mode.
target_heightINT00–8192Exact target height in pixels. 0 = ignore this mode.
smaller_sideINT00–8192Resize so the shorter side equals this length in pixels. 0 = off.
larger_sideINT00–8192Resize so the longer side equals this length in pixels. 0 = off.
scale_factorFLOAT0.00–10Multiply both dimensions by this factor. 0 = off.
keep_proportionBOOLEANtrueKeep aspect ratio. With both target_width and target_height set, cover-crops to fill; off distorts to the exact size.
upscale_methodCOMBObicubicInterpolation method used for resizing.
divisible_byINT11–256Round the final width and height to a multiple of this value.
megapixelsFLOAT1.000–256Target total pixel count in megapixels. Used only when no other size mode is set.
dont_enlargeBOOLEANfalseNever upscale above the original size.
maskoptMASKOptional mask resized together with the image.

Outputs (4)

NameTypeDescription
IMAGEIMAGEResized image.
widthINTFinal output width in pixels.
heightINTFinal output height in pixels.
MASKMASKResized mask (passthrough when no mask is connected).