Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize and restore images while maintaining quality, supporting multiple methods and aspect ratio preservation.
The LayerUtility: ImageScaleRestore node is designed to help you resize and restore images to a specific scale or dimension while maintaining the quality and integrity of the original image. This node is particularly useful for AI artists who need to adjust the size of their images for various applications, such as preparing images for different display formats or ensuring consistency across a series of images. The node supports multiple resizing methods, including bicubic, hamming, bilinear, box, and nearest, allowing you to choose the most suitable method for your specific needs. Additionally, it can handle masks and maintain the aspect ratio by scaling based on the longest side of the image. This flexibility ensures that your images are resized accurately and efficiently, preserving important details and minimizing distortion.
This parameter represents the input image or a batch of images that you want to resize. The images should be provided as tensors. The function will process each image in the batch individually.
This parameter defines the scaling factor for resizing the image. It is a float value where a value greater than 1 will enlarge the image, and a value less than 1 will reduce the image size. The default value is 1.0.
This parameter specifies the resizing method to be used. The available options are "bicubic", "hamming", "bilinear", "box", and "nearest". Each method has its own characteristics in terms of quality and processing time. The default method is "lanczos".
This boolean parameter determines whether the image should be scaled based on its longest side. If set to True, the image will be resized such that the longest side matches the specified longest_side parameter. The default value is False.
This parameter specifies the target length of the longest side of the image when scale_by_longest_side is set to True. It is an integer value that defines the desired size in pixels.
This optional parameter allows you to provide a mask for the image. The mask should be provided as a tensor. If a mask is provided, it will be resized along with the image to maintain alignment.
This optional parameter allows you to specify the original size of the image as a tuple (width, height). If provided, the image will be resized to this exact size instead of using the scale factor.
This output parameter returns the resized images as a tensor. The images are resized according to the specified scale or dimensions, maintaining the quality and aspect ratio as per the input parameters.
This output parameter returns the resized masks as a tensor, if a mask was provided. The masks are resized to match the dimensions of the resized images, ensuring proper alignment.
This output parameter provides the original dimensions of the input image(s) as a list [width, height]. This information can be useful for reference or further processing.
This output parameter returns the target width of the resized image(s). It is an integer value representing the width in pixels.
This output parameter returns the target height of the resized image(s). It is an integer value representing the height in pixels.
scale_by_longest_side
parameter and specify the desired longest_side
length.image
parameter for consistent processing.mask
parameter to ensure that the mask is resized along with the image, maintaining proper alignment.scale
, longest_side
, or original_size
parameters.© Copyright 2024 RunComfy. All Rights Reserved.