Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-988 > Ratio Calculator 988

ComfyUI Node: Ratio Calculator 988

Class Name

RatioCalc988

Category
🦇988/Image
Author
kajan988 (Account age: 0days)
Extension
ComfyUI-988
Latest Updated
2026-11-03
Github Stars
0.0K

How to Install ComfyUI-988

Install this extension via the ComfyUI Manager by searching for ComfyUI-988
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-988 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 988 Description

Finds and displays the closest aspect-ratio preset label from an image’s width and height.

Ratio Calculator 988:

Legacy version: This page documents RatioCalc988 at upstream commit b7a23efee0e3686171863899f1ec93ba9d948220. The node has been removed from the current extension. Its availability and interface here apply to that historical revision, not the latest release.

RatioCalc988 identifies the aspect-ratio preset that most closely matches an image’s width-to-height proportions. It compares the image’s proportions with a fixed set of landscape, square, and portrait presets, then displays the closest preset label. This helps you choose a matching format elsewhere in an image workflow without calculating the ratio yourself. The result is the nearest available preset, so it may not describe the image’s exact proportions.

Ratio Calculator 988 Input Parameters:

image

The required IMAGE to analyze. The node reads its width and height to determine the closest aspect-ratio preset; the image’s visual content does not affect the result. Connect an image-producing node here. The source specifies no default value, minimum, maximum, or selectable options for this input.

Ratio Calculator 988 Output Parameters:

ratio

The closest matching aspect-ratio label, such as 16:9 ▭ for an image with 16:9 proportions. The available labels cover square, landscape, and portrait presets, ranging from 9:32 ▯ through 32:9 ▭; the source also contains an empty-label entry, but its identical 1:1 proportions appear after the named 1:1 ◻ entry and do not replace that earlier match. Although the output socket is declared with a wildcard type, the implementation returns a label string. It also displays that label as text on the node.

Ratio Calculator 988 Usage Tips:

  • Connect the image whose dimensions you want to classify, then use the displayed label or the ratio output when selecting a corresponding preset later in your workflow.
  • An exact match is not required. For example, a 1920 × 1080 image has 16:9 proportions and returns 16:9 ▭; an image between presets returns whichever preset has the smallest width-to-height ratio difference.
  • There are no exposed settings to tune. If you need a different result, change the image’s dimensions before passing it to this node. Changing the depicted subject or other visual details will not change the ratio.

Ratio Calculator 988 Common Errors and Solutions:

Required input is missing

  • Explanation: If image is unconnected, the workflow cannot provide the required image. The exact validation message depends on the host.
  • Solution: Connect an IMAGE output to image and run the workflow again.

ValueError: not enough values to unpack (expected 4, got 3)

  • Explanation: The implementation expects image data with four dimensions: batch, height, width, and channels. A three-dimensional value does not match that shape.
  • Solution: Feed the node a standard IMAGE output from a compatible image node rather than manually reshaped image data.

ValueError: too many values to unpack (expected 4)

  • Explanation: Image data with more than four dimensions does not match the shape the node expects.
  • Solution: Remove the extra dimension upstream or use a compatible IMAGE output.

ZeroDivisionError: integer division or modulo by zero

  • Explanation: A zero-width or zero-height image can cause the width-and-height calculation to divide by zero. Such dimensions are not usable for an aspect-ratio comparison.
  • Solution: Check the upstream image source and provide an image with nonzero width and height.

Ratio Calculator 988 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-988
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 Models, enabling artists to harness the latest AI tools to create incredible art.

Ratio Calculator 988