Visit ComfyUI Online for ready-to-use ComfyUI environment
Align image dimensions to match another while preserving aspect ratio for consistent image sizes and visual integrity.
The Match Dimensions (mtb) node is designed to align the dimensions of one image to match those of another, while preserving the original aspect ratio. This is particularly useful when you need to ensure consistency in image sizes for various applications, such as creating uniform datasets or preparing images for further processing. By matching dimensions, you can avoid distortions and maintain the visual integrity of your images. The node offers flexibility by allowing you to choose whether to match the height or the width of the source image to the reference image, making it a versatile tool for image manipulation tasks.
The source
parameter is the image whose dimensions you want to adjust. This image will be resized to match the dimensions of the reference image, either in height or width, depending on the setting of the match
parameter. The source image should be provided in a compatible image format.
The reference
parameter is the image whose dimensions will be used as the reference for resizing the source image. The dimensions of this image will guide the resizing process to ensure that the source image matches either the height or the width of the reference image, as specified by the match
parameter.
The match
parameter determines which dimension of the source image will be adjusted to match the reference image. It accepts two options: height
and width
. If set to height
, the source image's height will be adjusted to match the reference image's height, and the width will be scaled proportionally to maintain the aspect ratio. Conversely, if set to width
, the source image's width will be adjusted to match the reference image's width, and the height will be scaled proportionally. The default value is height
.
The image
output is the resized version of the source image. This image will have its dimensions adjusted to match the specified dimension (height or width) of the reference image, while preserving the original aspect ratio.
The new_width
output provides the new width of the resized source image. This value is calculated based on the aspect ratio and the specified dimension to match (height or width) of the reference image.
The new_height
output provides the new height of the resized source image. This value is calculated based on the aspect ratio and the specified dimension to match (height or width) of the reference image.
match
parameter appropriately.height
option for the match
parameter when you want to ensure that the heights of your images are consistent, which is useful for creating uniform rows of images.width
option for the match
parameter when you want to ensure that the widths of your images are consistent, which is useful for creating uniform columns of images.on_mismatch
parameter is set to Error
.on_mismatch
parameter to either Smallest
or Largest
to allow automatic resizing.match
parameter is set to a value other than height
or width
.match
parameter to either height
or width
to specify the dimension to match.reference
parameter is not provided.source
parameter is not provided.© Copyright 2024 RunComfy. All Rights Reserved.