ComfyUI Node
Scale To Multiple Adv. π²
Scales image dimensions and/or integers to a specified multiple, with options for rounding mode and pre-scaling. 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 Adv. π²
- image
- scaled_image
- scaled_width
- scaled_height
βmultiple64βΊ
βcrop_modestretchβΊ
βresize_modelanczosβΊ
βrounding_mode_widthnearestβΊ
βrounding_mode_heightnearestβΊ
βscale_factor_width1.000βΊ
βscale_factor_height1.000βΊ
βwidthββΊ
βheightββΊ
CategoryRyuuNoodles π²/Images
Inputs (10)
| 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_width | COMBO | nearest | Rounding mode for width. 'nearest' will round to the nearest multiple of 'multiple' value. 'floor' will round down to the nearest multiple. 'ceil' will round up. |
| rounding_mode_height | COMBO | nearest | Rounding mode for 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_width | FLOAT | 1.000 | How much to multiply width by before scaling to multiple. |
| scale_factor_height | FLOAT | 1.000 | How much to multiply 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 | β |