ComfyUI > Nodes > DJZ-Nodes > Aspect Size

ComfyUI Node: Aspect Size

Class Name

AspectSize

Category
DJZ-Nodes
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

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

Aspect Size Description

Calculate optimal image dimensions based on aspect ratio and model type for AI artists, ensuring consistency and quality.

Aspect Size:

The AspectSize node is designed to help you calculate the optimal dimensions for images based on a specified aspect ratio and model type. This node is particularly useful for AI artists who need to ensure their images are generated with the correct proportions for different models, such as SD, SDXL, and Cascade. By inputting the desired aspect ratio and model type, the node computes the width and height that best fit the given parameters, ensuring that the resulting dimensions are divisible by a specified downscale factor. This functionality is crucial for maintaining image quality and consistency across different AI models, making it an essential tool for artists looking to optimize their workflow and achieve precise image outputs.

Aspect Size Input Parameters:

model_type

The model_type parameter specifies the type of model for which you are generating the image dimensions. It accepts three options: "SD", "SDXL", and "Cascade". Each model type corresponds to a different total pixel count, which affects the final dimensions of the image. Choosing the correct model type ensures that the image is generated with the appropriate resolution for the intended model.

aspect_ratio_width

The aspect_ratio_width parameter defines the width component of the desired aspect ratio. It is an integer value that, together with aspect_ratio_height, determines the proportions of the image. The default value is 1, and it can be adjusted in steps of 1. This parameter is crucial for setting the horizontal aspect of the image, influencing how wide the image will be relative to its height.

aspect_ratio_height

The aspect_ratio_height parameter defines the height component of the desired aspect ratio. Like aspect_ratio_width, it is an integer value that determines the proportions of the image. The default value is 1, and it can be adjusted in steps of 1. This parameter is essential for setting the vertical aspect of the image, influencing how tall the image will be relative to its width.

Aspect Size Output Parameters:

Width

The Width output parameter represents the calculated width of the image based on the specified aspect ratio and model type. It is an integer value that ensures the image width is optimal for the given parameters and divisible by the downscale factor. This output is crucial for generating images with the correct horizontal dimensions, ensuring compatibility with the chosen model.

Height

The Height output parameter represents the calculated height of the image based on the specified aspect ratio and model type. It is an integer value that ensures the image height is optimal for the given parameters and divisible by the downscale factor. This output is vital for generating images with the correct vertical dimensions, ensuring compatibility with the chosen model.

Aspect Size Usage Tips:

  • Ensure you select the correct model_type to match the AI model you are working with, as this affects the total pixel count and resulting image dimensions.
  • Adjust the aspect_ratio_width and aspect_ratio_height to achieve the desired proportions for your image, keeping in mind the default value is 1 for both parameters.
  • Use the downscale factor to control the divisibility of the output dimensions, which can help maintain image quality and compatibility with specific model requirements.

Aspect Size 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 less than the minimum allowed ratio. It indicates that the specified aspect ratio is too narrow.
  • Solution: Adjust the aspect_ratio_width and aspect_ratio_height to increase the aspect ratio, ensuring it meets the minimum requirement.

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

  • Explanation: This error occurs when the calculated aspect ratio exceeds the maximum allowed ratio. It indicates that the specified aspect ratio is too wide.
  • Solution: Adjust the aspect_ratio_width and aspect_ratio_height to decrease the aspect ratio, ensuring it does not exceed the maximum limit.

Aspect Size Related Nodes

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