ComfyUI > Nodes > Comfy_Felsirnodes > AspectRatio

ComfyUI Node: AspectRatio

Class Name

Aspect from Image

Category
Felsir
Author
Felsir (Account age: 3861days)
Extension
Comfy_Felsirnodes
Latest Updated
2026-03-10
Github Stars
0.02K

How to Install Comfy_Felsirnodes

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

AspectRatio Description

Calculates and adjusts image aspect ratios for consistency and artistic effect.

AspectRatio:

The Aspect from Image node is designed to calculate and manage the aspect ratio of an input image, ensuring that the image's proportions are maintained or adjusted according to specific requirements. This node is particularly useful for AI artists who need to work with images of varying dimensions and wish to standardize or modify their aspect ratios for consistency or artistic effect. By determining the aspect ratio, the node can help in resizing images while preserving their visual integrity, which is crucial for maintaining the intended composition and aesthetic quality. The node supports different model types, such as SDXL, and offers predefined aspect ratios like Vertical, Portrait, Square, Photo, Landscape, Widescreen, and Cinematic, each tailored to specific artistic or display needs. This flexibility allows you to choose the most suitable aspect ratio for your project, ensuring that your images are presented in the best possible format.

AspectRatio Input Parameters:

image_in

The image_in parameter represents the input image whose aspect ratio is to be calculated. This parameter is crucial as it serves as the basis for determining the aspect ratio, which influences how the image will be resized or adjusted. The image should be provided in a format that the node can process, typically as a tensor or a PIL image. The size of the image directly affects the aspect ratio calculation, which in turn impacts the final output dimensions.

modeltype

The modeltype parameter specifies the type of model being used, such as "SDXL". This parameter is important because it determines the set of predefined aspect ratios that will be available for selection. Different model types may have different aspect ratio requirements or preferences, and this parameter allows the node to tailor its calculations and outputs accordingly. By selecting the appropriate model type, you ensure that the aspect ratio adjustments align with the specific needs of your project or the capabilities of the model you are working with.

AspectRatio Output Parameters:

aspect

The aspect output parameter represents the calculated aspect ratio of the input image. This value is crucial for understanding the proportions of the image and for making informed decisions about resizing or adjusting the image. The aspect ratio is typically expressed as a float, representing the width-to-height ratio of the image. This output helps you maintain the visual integrity of the image when resizing, ensuring that the image does not become distorted or lose its intended composition.

width

The width output parameter indicates the width of the image after the aspect ratio has been applied. This value is important for determining the final dimensions of the image, especially when resizing or adjusting the image to fit specific display or artistic requirements. The width is calculated based on the selected aspect ratio and the model type, ensuring that the image maintains its visual integrity.

height

The height output parameter indicates the height of the image after the aspect ratio has been applied. Similar to the width, this value is crucial for determining the final dimensions of the image. The height is calculated in conjunction with the width to ensure that the image maintains its proportions and does not become distorted. By providing both width and height, the node ensures that the image is resized accurately according to the selected aspect ratio.

AspectRatio Usage Tips:

  • When working with images of different sizes, use the Aspect from Image node to standardize their aspect ratios, ensuring consistency across your project.
  • Select the appropriate model type to access predefined aspect ratios that best suit your artistic or display needs, such as Portrait for social media or Widescreen for cinematic presentations.
  • Consider the final display medium when choosing an aspect ratio, as different platforms or devices may have specific requirements or preferences for image dimensions.

AspectRatio Common Errors and Solutions:

Invalid Image Format

  • Explanation: The input image is not in a format that the node can process, such as an unsupported file type or corrupted data.
  • Solution: Ensure that the input image is in a supported format, such as a tensor or a PIL image, and that the file is not corrupted.

Unsupported Model Type

  • Explanation: The specified model type is not recognized by the node, leading to an inability to select predefined aspect ratios.
  • Solution: Verify that the model type is correctly specified and supported by the node, such as "SDXL", and adjust the input accordingly.

Aspect Ratio Calculation Error

  • Explanation: The aspect ratio could not be calculated due to an issue with the input image dimensions, such as a zero or negative value.
  • Solution: Check the input image dimensions to ensure they are valid and non-zero, and reprocess the image if necessary.

AspectRatio Related Nodes

Go back to the extension to check out more related nodes.
Comfy_Felsirnodes
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.