Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize and restore images while maintaining quality and integrity, with support for multiple interpolation methods.
LayerUtility: ImageScaleRestore V2 is a powerful node designed to help you resize and restore images to a desired scale or dimension while maintaining the quality and integrity of the original image. This node is particularly useful for AI artists who need to upscale or downscale images for various applications, such as preparing images for training models, creating consistent image sizes for a project, or restoring images to their original dimensions after processing. The node supports multiple interpolation methods, ensuring that you can choose the best method for your specific needs. By leveraging this node, you can achieve high-quality image resizing with minimal loss of detail, making it an essential tool in your image processing workflow.
This parameter represents the input image or a batch of images that you want to resize. The images should be provided in a tensor format, which is commonly used in deep learning frameworks. The quality and resolution of the input image will directly impact the results of the resizing process.
This parameter defines the scaling factor by which the input image will be resized. A value greater than 1 will upscale the image, while a value less than 1 will downscale it. The default value is typically 1, meaning no scaling. Adjusting this parameter allows you to control the size of the output image relative to the original.
This parameter specifies the interpolation method used for resizing the image. Available options include "bicubic," "hamming," "bilinear," "box," and "nearest." Each method has its own characteristics and is suitable for different types of images and desired outcomes. For example, "bicubic" is often used for high-quality resizing, while "nearest" is faster but may produce blocky results.
This parameter determines whether the scaling should be based on the longest side of the image or another criterion. It allows for more flexible resizing options, ensuring that the aspect ratio of the image is maintained or adjusted according to your needs.
This parameter sets the target length for the longest side of the image when scale_by
is enabled. It ensures that the resized image fits within the specified dimensions, making it useful for standardizing image sizes across a dataset or project.
This optional parameter allows you to provide a mask image that will be resized along with the input image. The mask can be used to preserve certain areas of the image during processing, ensuring that important details are not lost. If no mask is provided, a default white mask will be used.
This optional parameter specifies the original dimensions of the image. If provided, the node will restore the image to these dimensions instead of using the scaling factor. This is useful for reverting images to their original size after processing or transformations.
This output parameter contains the resized images in tensor format. The images will be scaled according to the specified parameters, ensuring high-quality results that maintain the integrity of the original images.
This output parameter contains the resized masks in tensor format, if a mask was provided. The masks will be scaled along with the images, ensuring that any important areas defined by the masks are preserved during the resizing process.
This output parameter provides the original width and height of the input images. It is useful for reference and for any further processing that may require knowledge of the original image dimensions.
This output parameter indicates the width of the resized images. It is determined based on the scaling factor or the specified target dimensions, ensuring that the output images meet your requirements.
This output parameter indicates the height of the resized images. Similar to target_width
, it is determined based on the scaling factor or the specified target dimensions.
scale_by
and scale_by_length
parameters to ensure consistent dimensions across all images.method
parameter and ensure it is set to one of the supported methods: "bicubic," "hamming," "bilinear," "box," or "nearest."© Copyright 2024 RunComfy. All Rights Reserved.