Nodes/TenguPad/TenguPad v0.4
ComfyUI Node

TenguPad v0.4

Resize image while preserving aspect ratio, then pad/crop to target dimensions. Features true RGB padding color control (0-255), customizable position for both pad and crop modes, aspect modes, CONTENT SCALE to adjust image size within the padded canvas, and CROP POSITION control.

By tekijiyuu·Created 6 months ago·Updated 5 months ago· 0
TenguPad v0.4
  • image
  • IMAGE
  • mask
  • Width
  • Height
target_width512
target_height512
aspect_ratio_modepad
content_scale1.00
padding_positioncenter
crop_positioncenter
interpolationlanczos
feather_pixels0
mask_dilation0
color_presetgreen
pad_r255
pad_g255
pad_b255
Categoryimage/transform

Inputs (14)

NameTypeDefaultDescription
imageIMAGE
target_widthINT5121–8192
target_heightINT5121–8192
aspect_ratio_modeCOMBOpad• pad: Preserve aspect ratio with padding • crop: Preserve aspect ratio by cropping overflow • stretch: Ignore aspect ratio, stretch to fit
content_scaleFLOAT1.000.01–2Scale image content within padded space: • < 1.0: Make image smaller inside padding (adds extra padding) • = 1.0: Normal padding behavior • > 1.0: Enlarge content (may cause cropping in pad mode)
padding_positionCOMBOcenterPosition of content within padded canvas (used in 'pad' mode)
crop_positionCOMBOcenterWhich part of the image to preserve when cropping (used in 'crop' mode)
interpolationCOMBOlanczos5 options: lanczos, bicubic, bilinear, area, nearest-exact
feather_pixelsINT00–100Number of pixels to feather the mask edges for smooth transitions
mask_dilationINT0-100–100Positive values dilate (expand) the mask, negative values erode (shrink) the mask
color_presetCOMBOgreenQuickly set RGB values. Select 'custom' for manual control.
pad_rINT2550–255
pad_gINT2550–255
pad_bINT2550–255

Outputs (4)

NameTypeDescription
IMAGEIMAGE
maskMASK
WidthINTFinal output image width in pixels
HeightINTFinal output image height in pixels