Visit ComfyUI Online for ready-to-use ComfyUI environment
Adjust image resolution based on aspect ratio for Stable Diffusion models, optimizing visual integrity and workflow efficiency.
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.
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.
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.
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.
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.
stable_diffusion
parameter is set to either "1.5" or "SDXL".image
parameter is correctly provided and is in a compatible format.© Copyright 2024 RunComfy. All Rights Reserved.