ComfyUI Node
Scale To Multiple π²
Scales image dimensions and/or integers to a specified multiple, with simplified controls. If no image is provided, only the width and height will be scaled. If image and width and/or height is provided, the image will use the provided dimension for scaling instead of it's own width/height. This will work as a width/height override.
Scale To Multiple π²
- image
- scaled_image
- scaled_width
- scaled_height
βmultiple64βΊ
βcrop_modestretchβΊ
βresize_modelanczosβΊ
βrounding_modenearestβΊ
βscale_factor1.000βΊ
βwidthββΊ
βheightββΊ
CategoryRyuuNoodles π²/Images
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| multiple | INT | 64 | Multiple to scale to. Setting to 1 effectively disables this. |
| crop_mode | COMBO | stretch | Crop mode for the image. 'stretch' will stretch the image to fill the target dimensions. 'center' will center the image in the target dimensions. 'fill' will scale the image to fill the target dimensions while maintaining aspect ratio, cropping if necessary. 'uniform' will scale the image to fit within the target dimensions while maintaining aspect ratio. 'uniform fill' will scale the image to fill the target dimensions while maintaining aspect ratio, adding padding if necessary. |
| resize_mode | COMBO | lanczos | Resize mode for the image. 'bilinear - tensor' is different from normal bilinear, it will use torch.nn.functional.interpolate() to resize the image and look very different from normal bilinear. |
| rounding_mode | COMBO | nearest | Rounding mode for both width and height. 'nearest' will round to the nearest multiple of 'multiple' value. 'floor' will round down to the nearest multiple. 'ceil' will round up. |
| scale_factor | FLOAT | 1.000 | How much to multiply both width and height by before scaling to multiple. |
| imageopt | IMAGE | Image to scale. If not provided, only width and height will be scaled. If either or both of the optional width/height inputs are provided, the resizing will use the given input(s). | |
| widthopt | INT | Optional width to scale the image to after the multiple scaling. If no image is provided it will still output the scaled number. | |
| heightopt | INT | Optional height to scale the image to after the multiple scaling. If no image is provided it will still output the scaled number. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| scaled_image | IMAGE | β |
| scaled_width | INT | β |
| scaled_height | INT | β |