Visit ComfyUI Online for ready-to-use ComfyUI environment
Adjust image dimensions while maintaining quality, aspect ratio, and offering upscaling/downscaling with advanced interpolation methods.
The ImageResize
node is designed to adjust the dimensions of an image while maintaining its quality and aspect ratio. This node is particularly useful for AI artists who need to prepare images for various applications, ensuring that the images fit specific size requirements without distortion. The node offers flexibility in resizing by allowing both upscaling and downscaling, depending on the desired output size. It uses advanced interpolation methods, such as bicubic interpolation, to ensure smooth transitions and high-quality results. Additionally, the node can handle padding and cropping, which helps in achieving the exact aspect ratio or dimensions needed for a project. This makes it an essential tool for artists looking to optimize their images for different platforms or creative needs.
The pixels
parameter represents the image data that you want to resize. It is typically a multi-dimensional array containing pixel values. This parameter is crucial as it forms the basis of the resizing operation, and its quality directly affects the output image.
The action
parameter determines whether the image will be cropped or padded to achieve the desired aspect ratio. This choice impacts how the image's content is adjusted during resizing, either by removing parts of the image or adding space around it.
The smaller_side
parameter specifies the target size for the smaller dimension of the image. This helps in maintaining the aspect ratio while resizing, ensuring that the image does not become distorted.
The larger_side
parameter sets the target size for the larger dimension of the image. It is used to control the maximum size of the image, which is particularly useful when you want to upscale an image without exceeding a certain size.
The scale_factor
parameter is a multiplier that determines how much the image should be scaled. It is automatically calculated based on the desired dimensions and the current size of the image, ensuring that the resizing operation is proportional.
The resize_mode
parameter specifies whether the image should be upscaled or downscaled. This choice affects the scale factor and ensures that the image is resized in the intended direction, either increasing or decreasing its size.
The side_ratio
parameter defines the aspect ratio that the image should maintain after resizing. This is important for ensuring that the image's proportions remain consistent, which is crucial for aesthetic and functional purposes.
The crop_pad_position
parameter determines the position where cropping or padding should occur. This affects how the image is adjusted spatially, allowing for control over which parts of the image are emphasized or minimized.
The pad_feathering
parameter controls the smoothness of the padding edges. This is useful for creating a more natural transition between the image and the padded areas, enhancing the overall visual quality.
The mask_optional
parameter is an optional input that allows you to provide a mask for the image. This mask can be used to specify areas of the image that should be preserved or altered during the resizing process, offering additional control over the final output.
The pixels
output parameter provides the resized image data. This is the main result of the node's operation, reflecting the changes made according to the specified input parameters. The quality and dimensions of this output are directly influenced by the node's configuration.
The mask
output parameter returns the adjusted mask, if one was provided. This output is useful for further processing or analysis, as it reflects any changes made to the mask during the resizing operation.
bicubic
interpolation mode, which provides smooth transitions and reduces artifacts.side_ratio
matches the platform's requirements to avoid distortion.smaller_side
or larger_side
.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.