ComfyUI > Nodes > ComfyUI Steudio > Ratio Calculator

ComfyUI Node: Ratio Calculator

Class Name

Ratio Calculator

Category
Steudio/Utils
Author
Steudio (Account age: 459days)
Extension
ComfyUI Steudio
Latest Updated
2025-05-10
Github Stars
0.04K

How to Install ComfyUI Steudio

Install this extension via the ComfyUI Manager by searching for ComfyUI Steudio
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Steudio in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Ratio Calculator Description

Simplify image aspect ratios with AI artist-friendly Ratio Calculator node, ensuring visual consistency effortlessly.

Ratio Calculator:

The Ratio Calculator node is designed to simplify the process of determining the aspect ratio of an image by analyzing its dimensions. This node is particularly useful for AI artists who need to maintain specific aspect ratios for their creative projects. By calculating the greatest common divisor (GCD) of the image's width and height, the node simplifies these dimensions to their smallest possible ratio. It then compares this simplified ratio against a predefined set of common aspect ratios to find the closest match. This functionality is essential for ensuring that images conform to desired proportions, which is crucial for maintaining visual consistency across different media formats. The Ratio Calculator is a valuable tool for artists who want to ensure their images are correctly proportioned without needing to manually calculate or guess the aspect ratio.

Ratio Calculator Input Parameters:

image

The image parameter is the sole input for the Ratio Calculator node. It represents the image whose aspect ratio you wish to calculate. The function of this parameter is to provide the node with the necessary data to analyze the image's dimensions. The impact of this parameter on the node's execution is significant, as the accuracy of the aspect ratio calculation depends on the dimensions of the provided image. There are no specific minimum, maximum, or default values for this parameter, as it simply requires an image input. The image should be in a format that the node can process, typically a standard image file format like JPEG or PNG.

Ratio Calculator Output Parameters:

ratio

The ratio output parameter provides the closest matching aspect ratio for the input image. This output is crucial as it informs you of the aspect ratio that best fits the dimensions of the image you provided. The importance of this output lies in its ability to help you maintain consistent visual proportions across your work, ensuring that images are displayed correctly in various contexts. The output value is a string representing the aspect ratio, such as "16:9" or "4:3", which you can use to adjust or verify the proportions of your images.

Ratio Calculator Usage Tips:

  • Ensure that the image you input is in a standard format and has clear dimensions to get an accurate aspect ratio calculation.
  • Use the Ratio Calculator to quickly verify the aspect ratio of images before incorporating them into larger projects, ensuring consistency across your work.
  • Familiarize yourself with common aspect ratios to better understand the output and how it applies to your specific needs.

Ratio Calculator Common Errors and Solutions:

Aspect ratio cannot reduce to any less than <minimum_ratio_str> (<minimum_ratio>), but was <aspect_ratio> (<calculated_ratio>).

  • Explanation: This error occurs when the calculated aspect ratio is smaller than the minimum allowed ratio.
  • Solution: Check the dimensions of your image to ensure they are correct and consider resizing the image to fit within the acceptable aspect ratio range.

Aspect ratio cannot reduce to any greater than <maximum_ratio_str> (<maximum_ratio>), but was <aspect_ratio> (<calculated_ratio>).

  • Explanation: This error is triggered when the calculated aspect ratio exceeds the maximum allowed ratio.
  • Solution: Verify the image dimensions and adjust them if necessary to ensure they fall within the acceptable aspect ratio range.

Ratio Calculator Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Steudio
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.