Visit ComfyUI Online for ready-to-use ComfyUI environment
Calculates image aspect ratio for AI artists, determining landscape, portrait, or square format, aiding image processing decisions.
The Image Aspect Ratio node is designed to calculate and provide detailed information about the aspect ratio of an image. This node is particularly useful for AI artists who need to understand the dimensions and orientation of their images, whether they are working with specific width and height values or an image tensor. By determining the aspect ratio, this node helps you identify whether an image is in landscape, portrait, or square format, which can be crucial for various artistic and technical applications. Additionally, it provides a common aspect ratio representation and a boolean value indicating if the image is in landscape mode, making it easier to make informed decisions about image processing and composition.
This optional parameter accepts an image tensor. If provided, the node will use the dimensions of this image to calculate the aspect ratio. This is useful when you have an image tensor and want to quickly determine its aspect ratio without manually inputting width and height values.
This optional parameter accepts a numerical value representing the width of the image. If both width and height are provided, the node will use these values to calculate the aspect ratio. This parameter is useful when you know the exact dimensions of your image and prefer to input them directly.
This optional parameter accepts a numerical value representing the height of the image. Similar to the width parameter, if both height and width are provided, the node will use these values to calculate the aspect ratio. This parameter is useful when you know the exact dimensions of your image and prefer to input them directly.
This output provides the aspect ratio as a numerical value. It represents the ratio of the width to the height of the image, giving you a precise understanding of the image's dimensions.
This output also provides the aspect ratio as a floating-point number, which is essentially the same as the aspect_number but in a different format. This can be useful for further calculations or when a floating-point representation is required.
This output is a boolean value indicating whether the image is in landscape mode. A value of 1 means the image is in landscape mode (width is greater than height), while a value of 0 means it is not. This helps you quickly determine the orientation of the image.
This output provides the aspect ratio in a common format, such as "16:9" or "4:3". It simplifies the aspect ratio into a more recognizable and standard representation, which can be useful for various applications, including printing and display settings.
This output provides a textual description of the aspect ratio type, indicating whether the image is in "landscape", "portrait", or "square" format. This helps you understand the general orientation and shape of the image at a glance.
image
parameter when you have an image tensor and want to quickly determine its aspect ratio without manually inputting dimensions.width
and height
parameters directly to get precise aspect ratio calculations.aspect_ratio_common
output to get a standard representation of the aspect ratio, which can be useful for setting up displays or printing.is_landscape_bool
output to quickly determine if your image is in landscape mode, which can help in making decisions about image composition and layout.image
parameter or both width
and height
values to avoid this error.© Copyright 2024 RunComfy. All Rights Reserved.