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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| target_width | INT | 5121–8192 | — |
| target_height | INT | 5121–8192 | — |
| aspect_ratio_mode | COMBO | pad | • pad: Preserve aspect ratio with padding • crop: Preserve aspect ratio by cropping overflow • stretch: Ignore aspect ratio, stretch to fit |
| content_scale | FLOAT | 1.000.01–2 | Scale 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_position | COMBO | center | Position of content within padded canvas (used in 'pad' mode) |
| crop_position | COMBO | center | Which part of the image to preserve when cropping (used in 'crop' mode) |
| interpolation | COMBO | lanczos | 5 options: lanczos, bicubic, bilinear, area, nearest-exact |
| feather_pixels | INT | 00–100 | Number of pixels to feather the mask edges for smooth transitions |
| mask_dilation | INT | 0-100–100 | Positive values dilate (expand) the mask, negative values erode (shrink) the mask |
| color_preset | COMBO | green | Quickly set RGB values. Select 'custom' for manual control. |
| pad_r | INT | 2550–255 | — |
| pad_g | INT | 2550–255 | — |
| pad_b | INT | 2550–255 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| mask | MASK | — |
| Width | INT | Final output image width in pixels |
| Height | INT | Final output image height in pixels |