ComfyUI Node
Resize Image (KJ/SET)
Resizes the image to the specified width and height. Size can be retrieved from the input (when w=h=0) or a reference image. Keep proportions keeps the aspect ratio of the image, by highest dimension.
Resize Image (KJ/SET)
- image
- mask
- get_image_size
- IMAGE
- width
- height
- mask
◄width512►
◄height512►
◄upscale_methodbicubic►
◄keep_proportionstretch►
◄pad_color#000000►
◄crop_positioncenter►
◄divisible_by2►
◄device▾►
◄per_batch0►
◄pad_transparency1.0►
Categoryimage/manipulation
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image to resize | |
| width | INT | 5120–16384 | Used when no `get_image_size` is provided |
| height | INT | 5120–16384 | Used when no `get_image_size` is provided |
| upscale_method | COMBO | bicubic | Interpolation method for image resize |
| keep_proportion | COMBO | stretch | `stretch` doesn't keep the aspect ratio `pad` adds `pad_color` bars `pad_edge` fills using the edge color `resize` always keeps aspect, so W and H might change `crop` takes a portion of the image |
| pad_color | STRING | #000000 | Color for fill. Can be an hexadecimal (#RRGGBB). Can comma separated RGB values in [0-255] or [0-1.0] range. |
| crop_position | COMBO | center | Also used for `pad` |
| divisible_by | INT | 20–512 | Force the final size to be divisible by |
| maskopt | MASK | Optional mask for the image will be resized | |
| deviceopt | COMBO | 2 options: cpu, gpu | |
| get_image_sizeopt | IMAGE | Image size to use as reference | |
| per_batchopt | INT | 00–16384 | Process images in sub-batches to reduce memory usage. 0 disables sub-batching. |
| pad_transparencyopt | FLOAT | 1.00–1 | The transparency for the padded area for all modes except `edge_pixel`.1.0 is fully transparent, 0.0 is fully opaque. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| width | INT | — |
| height | INT | — |
| mask | MASK | — |