Visit ComfyUI Online for ready-to-use ComfyUI environment
Adjust image aspect ratio to match preset dimensions for visual consistency and standardization.
The MatchImageRatioToPreset
node is designed to help you adjust the aspect ratio of an image to match a predefined set of standard dimensions. This is particularly useful when you need to ensure that your images conform to specific size requirements, such as for printing, web design, or other digital media applications. By comparing the aspect ratio of your input image to a list of preset ratios, the node identifies the closest match and adjusts the image dimensions accordingly. This process helps maintain visual consistency and quality across different images, making it easier to work with standardized formats.
The image
parameter is the input image that you want to adjust. This parameter accepts an image file and is essential for the node to perform its function. The image's aspect ratio will be compared to the preset ratios to find the closest match.
The width_offset
parameter allows you to adjust the width of the matched preset dimension. It accepts integer values ranging from -128 to 128, with a default value of 0. This parameter is useful if you need to fine-tune the width of the output image to better fit your specific requirements.
The height_offset
parameter allows you to adjust the height of the matched preset dimension. It accepts integer values ranging from -128 to 128, with a default value of 0. Similar to the width_offset
, this parameter helps you fine-tune the height of the output image for more precise control over the final dimensions.
The standard_width
parameter represents the width of the closest matching preset dimension. This output helps you understand the adjusted width of your image after matching it to the preset ratios.
The standard_height
parameter represents the height of the closest matching preset dimension. This output provides the adjusted height of your image, ensuring it conforms to the closest preset ratio.
The min
parameter indicates the smaller value between the standard_width
and standard_height
. This output is useful for understanding the minimum dimension of the adjusted image, which can be important for certain design or layout considerations.
The max
parameter indicates the larger value between the standard_width
and standard_height
. This output helps you understand the maximum dimension of the adjusted image, which can be crucial for maintaining visual consistency and quality.
width_offset
and height_offset
parameters to fine-tune the dimensions of your image, ensuring it fits perfectly within your design requirements.min
and max
output parameters to make informed decisions about image placement and scaling in your projects.image
parameter is not supplied.width_offset
or height_offset
values are outside the allowed range of -128 to 128. - Solution: Adjust the width_offset
and height_offset
values to be within the specified range.© Copyright 2024 RunComfy. All Rights Reserved.