ComfyUI > Nodes > DJZ-Nodes > Aspect Size V2

ComfyUI Node: Aspect Size V2

Class Name

AspectSizeV2

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 V2 Description

Calculate optimal image dimensions based on aspect ratio for AI models like SD, SDXL, and Cascade, ensuring compatibility and visual consistency.

Aspect Size V2:

AspectSizeV2 is a node designed to calculate optimal image dimensions based on a specified aspect ratio and model type, ensuring that the resulting dimensions are suitable for various AI models like SD, SDXL, and Cascade. This node is particularly beneficial for AI artists who need to maintain specific aspect ratios while working with different model resolutions. By automatically adjusting the width and height to be divisible by a given downscale factor, AspectSizeV2 ensures that the generated dimensions are compatible with the model's requirements, thus streamlining the process of preparing images for AI processing. This node is essential for maintaining visual consistency and quality across different AI-generated artworks.

Aspect Size V2 Input Parameters:

model_type

The model_type parameter specifies the type of AI model for which the image dimensions are being calculated. It determines the total number of pixels that the image should contain, with options including SD (512x512 pixels), SDXL (1024x1024 pixels), and Cascade (2048x2048 pixels). Choosing the correct model type is crucial as it directly impacts the resolution and quality of the output image.

aspect_ratio_width

The aspect_ratio_width parameter represents the width component of the desired aspect ratio. It is used in conjunction with aspect_ratio_height to calculate the aspect ratio decimal, which influences the proportional dimensions of the output image. This parameter does not have a predefined range but should be chosen to reflect the desired visual proportions of the image.

aspect_ratio_height

The aspect_ratio_height parameter represents the height component of the desired aspect ratio. Similar to aspect_ratio_width, it is used to calculate the aspect ratio decimal. This parameter should be selected to achieve the intended visual balance in the output image, ensuring that the width and height are proportionally accurate.

downscale_factor

The downscale_factor parameter is used to adjust the calculated width and height so that they are divisible by this factor. This ensures compatibility with the model's requirements and can help optimize the image for processing. The default value is typically set to 16, but it can be adjusted based on specific needs or constraints.

Aspect Size V2 Output Parameters:

width

The width output parameter represents the calculated width of the image, adjusted to maintain the specified aspect ratio and model type. It is an integer value that ensures the image's width is divisible by the downscale_factor, making it suitable for processing by the chosen AI model.

height

The height output parameter represents the calculated height of the image, similarly adjusted to maintain the specified aspect ratio and model type. Like the width, it is an integer value that ensures the image's height is divisible by the downscale_factor, ensuring compatibility with the AI model's requirements.

Aspect Size V2 Usage Tips:

  • Ensure that the model_type is correctly set to match the AI model you are working with, as this will affect the total pixel count and resolution of the output image.
  • Adjust the aspect_ratio_width and aspect_ratio_height to achieve the desired visual proportions, keeping in mind the artistic intent and composition of your work.
  • Use the downscale_factor to fine-tune the dimensions for compatibility with specific model requirements, especially if you encounter issues with image processing.

Aspect Size V2 Common Errors and Solutions:

Invalid model type

  • Explanation: The model_type provided does not match any of the expected options (SD, SDXL, Cascade).
  • Solution: Ensure that the model_type is correctly specified as one of the supported options to calculate the appropriate pixel count.

Division by zero error

  • Explanation: This error occurs if aspect_ratio_height is set to zero, leading to a division by zero when calculating the aspect ratio decimal.
  • Solution: Verify that aspect_ratio_height is a non-zero value to avoid this error and ensure proper aspect ratio calculation.

Aspect Size V2 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.