Nodes/ComfyUI-PadToSquare/Pad Image To Square
ComfyUI Node

Pad Image To Square

Pads an image to a square, optionally resizing it so its longest side matches a given size.

By fraudrice·Created 9 days ago·Updated 9 days ago· 0
Pad Image To Square
  • image
  • image
  • inverted_mask
◄longest_side0►
◄upscale_methodlanczos►
Categoryimage/transform

Inputs (3)

NameTypeDefaultDescription
imageIMAGE—
longest_sideoptINT00–16384Resize so the longest side equals this before padding. 0 keeps the original size.
upscale_methodoptCOMBOlanczos5 options: lanczos, bicubic, bilinear, area, nearest-exact

Outputs (2)

NameTypeDescription
imageIMAGEThe square, padded image.
inverted_maskMASK1 over the original image area, 0 over the padding.