ComfyUI  >  Nodes  >  ComfyUI_yanc >  😼> Resolution by Aspect Ratio

ComfyUI Node: 😼> Resolution by Aspect Ratio

Class Name

> Resolution by Aspect Ratio

Category
YANC/😼 Image
Author
ALatentPlace (Account age: 1499 days)
Extension
ComfyUI_yanc
Latest Updated
7/26/2024
Github Stars
0.0K

How to Install ComfyUI_yanc

Install this extension via the ComfyUI Manager by searching for  ComfyUI_yanc
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_yanc 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

😼> Resolution by Aspect Ratio Description

Adjust image resolution based on aspect ratio for Stable Diffusion models, optimizing visual integrity and workflow efficiency.

😼> Resolution by Aspect Ratio:

The "Resolution by Aspect Ratio" node is designed to adjust the resolution of an image based on its aspect ratio, ensuring that the output resolution is optimized for specific versions of Stable Diffusion models, such as SD 1.5 or SDXL. This node calculates the greatest common divisor (GCD) of the image's width and height to determine the aspect ratio, then selects the closest common aspect ratio and resolution from predefined sets. This process ensures that the image maintains its visual integrity and is compatible with the chosen Stable Diffusion model, providing a seamless and efficient workflow for AI artists.

😼> Resolution by Aspect Ratio Input Parameters:

stable_diffusion

This parameter specifies the version of the Stable Diffusion model being used, either "1.5" or "SDXL". The choice of model affects the set of resolutions that the node will consider when adjusting the image's resolution. For instance, selecting "1.5" will use a different set of resolutions compared to "SDXL", ensuring compatibility and optimal performance for the chosen model.

image

This parameter represents the input image that will be processed by the node. The image's dimensions (height and width) are used to calculate the aspect ratio and determine the appropriate resolution. The image should be provided in a format that can be manipulated by the node, typically as a tensor or array.

😼> Resolution by Aspect Ratio Output Parameters:

width

This output parameter represents the adjusted width of the image after processing. The width is determined based on the closest matching resolution that maintains the original aspect ratio and is compatible with the selected Stable Diffusion model.

height

This output parameter represents the adjusted height of the image after processing. Similar to the width, the height is calculated to ensure the image's aspect ratio is preserved and is suitable for the chosen Stable Diffusion model.

😼> Resolution by Aspect Ratio Usage Tips:

  • Ensure that you select the correct Stable Diffusion model version to get the most appropriate resolution for your image.
  • Use high-quality input images to maintain visual integrity after the resolution adjustment.
  • If the output resolution does not meet your expectations, consider manually adjusting the aspect ratio or resolution settings.

😼> Resolution by Aspect Ratio Common Errors and Solutions:

"Invalid Stable Diffusion model version"

  • Explanation: The specified Stable Diffusion model version is not recognized.
  • Solution: Ensure that the stable_diffusion parameter is set to either "1.5" or "SDXL".

"Image dimensions not found"

  • Explanation: The node could not determine the dimensions of the input image.
  • Solution: Verify that the image parameter is correctly provided and is in a compatible format.

"No matching resolution found"

  • Explanation: The node could not find a resolution that matches the calculated aspect ratio.
  • Solution: Check the predefined sets of resolutions for the selected Stable Diffusion model and ensure they include a resolution that matches your image's aspect ratio.

😼> Resolution by Aspect Ratio Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_yanc
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.