Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize images by factor with quality control and resampling options for precise adjustments and enhancements.
The Image Resize Factor (mtb) node is designed to resize images by a specified factor, providing a flexible and efficient way to scale images up or down. This node is particularly useful for AI artists who need to adjust the dimensions of their images while maintaining quality. It supports various resampling methods to ensure the resized image meets the desired quality standards. Additionally, the node offers an optional supersampling feature to further enhance the image resolution. This makes it an essential tool for tasks that require precise control over image size and quality, such as preparing images for different display formats or optimizing them for further processing.
This parameter expects a tensor representing the image to be resized. The tensor should have a shape of either (H, W, C) for a single image or (B, H, W, C) for a batch of images, where H is height, W is width, C is the number of channels, and B is the batch size. The image tensor is the primary input that will be processed by the node.
This parameter is a float that determines the scaling factor for resizing the image. A factor greater than 1 will upscale the image, while a factor less than 1 will downscale it. The default value is typically set to 1.0, meaning no scaling. Adjusting this factor allows you to control the new dimensions of the image.
This boolean parameter indicates whether to apply supersampling after the initial resize. When set to True, the image will be further upscaled by a factor of 2 using the specified resampling method. This can help enhance the image quality, especially when significant upscaling is required. The default value is False.
This parameter specifies the resampling method to be used during resizing. Options include "nearest", "bilinear", "bicubic", and other methods supported by PyTorch's F.interpolate
function. The choice of resampling method affects the quality and smoothness of the resized image. For example, "bilinear" and "bicubic" are commonly used for high-quality resizing.
This optional parameter allows you to provide a mask tensor that will be applied to the resized image. The mask should have the same height and width as the original image and can be used to selectively apply the resizing effect to certain parts of the image. If no mask is provided, the entire image will be resized uniformly.
The output is a tensor representing the resized image. The shape of the tensor will match the input format, either (H, W, C) for a single image or (B, H, W, C) for a batch of images, but with the new dimensions as determined by the scaling factor. This resized image can then be used for further processing or display.
© Copyright 2024 RunComfy. All Rights Reserved.