ComfyUI Node
TS Image Resize
Resize by exact size, one side, megapixels or scale, with divisor snapping and an optional no-enlarge guard.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| pixels | IMAGE | Image to resize. | |
| target_width | INT | 00–8192 | Exact target width in pixels. 0 = ignore this mode. |
| target_height | INT | 00–8192 | Exact target height in pixels. 0 = ignore this mode. |
| smaller_side | INT | 00–8192 | Resize so the shorter side equals this length in pixels. 0 = off. |
| larger_side | INT | 00–8192 | Resize so the longer side equals this length in pixels. 0 = off. |
| scale_factor | FLOAT | 0.00–10 | Multiply both dimensions by this factor. 0 = off. |
| keep_proportion | BOOLEAN | true | Keep aspect ratio. With both target_width and target_height set, cover-crops to fill; off distorts to the exact size. |
| upscale_method | COMBO | bicubic | Interpolation method used for resizing. |
| divisible_by | INT | 11–256 | Round the final width and height to a multiple of this value. |
| megapixels | FLOAT | 1.000–256 | Target total pixel count in megapixels. Used only when no other size mode is set. |
| dont_enlarge | BOOLEAN | false | Never upscale above the original size. |
| maskopt | MASK | Optional mask resized together with the image. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | Resized image. |
| width | INT | Final output width in pixels. |
| height | INT | Final output height in pixels. |
| MASK | MASK | Resized mask (passthrough when no mask is connected). |