Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize images based on specified dimension while maintaining aspect ratio for uniformity in dimensions.
The "Scale Image to Side" node is designed to resize an image based on a specified dimension, either the width or height, while maintaining the aspect ratio. This node is particularly useful when you need to ensure that an image fits within a certain dimension without distorting its proportions. By scaling the image to the longer or shorter side, you can achieve a consistent look across different images, making it ideal for tasks such as preparing images for web display, printing, or any scenario where uniformity in image dimensions is required. The node also offers options for interpolation methods to control the quality of the scaling process.
This parameter represents the input image that you want to scale. It should be provided in a format that the node can process, typically as an image tensor.
This parameter specifies the target size for the scaling operation. It determines the new dimension (either width or height) to which the image will be scaled. The value should be a positive integer representing the number of pixels.
This parameter determines which side of the image will be scaled to the target size. Options include "width" to scale based on the image's width, "height" to scale based on the image's height, "shortest" to scale based on the shorter side, and "longest" to scale based on the longer side. This ensures that the aspect ratio is maintained.
This parameter defines the method used for interpolating pixel values during the scaling process. Available options include "nearest-exact", "bilinear", "area", "bicubic", and "lanczos". Each method offers a different balance between performance and image quality.
This parameter allows you to specify a modulo value to ensure that the new dimensions are multiples of a certain number. This can be useful for certain applications where specific dimension constraints are required.
This optional parameter allows you to provide a mask that will be scaled along with the image. The mask can be used for various purposes, such as preserving certain areas of the image during the scaling process.
The output is the scaled image, resized according to the specified parameters while maintaining the aspect ratio. The image will be returned in the same format as the input, typically as an image tensor.
scale_to
parameter must be a positive integer.scale_to
value is greater than zero and is an integer.© Copyright 2024 RunComfy. All Rights Reserved.