ComfyUI > Nodes > wlsh_nodes > Resolutions by Ratio (WLSH)

ComfyUI Node: Resolutions by Ratio (WLSH)

Class Name

Resolutions by Ratio (WLSH)

Category
WLSH Nodes/number
Author
wallish77 (Account age: 2229days)
Extension
wlsh_nodes
Latest Updated
2024-06-19
Github Stars
0.08K

How to Install wlsh_nodes

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

Resolutions by Ratio (WLSH) Description

Generate image resolutions based on aspect ratios and orientations for AI artists, ensuring consistency and optimization for various media formats.

Resolutions by Ratio (WLSH):

The Resolutions by Ratio (WLSH) node is designed to help you generate image resolutions based on specific aspect ratios and orientations. This node is particularly useful for AI artists who need to create images with precise dimensions that adhere to common aspect ratios, such as 16:9 for widescreen or 1:1 for square images. By inputting an aspect ratio, a direction (landscape or portrait), and a short side length, the node calculates the corresponding width and height, ensuring the resulting resolution is aligned with your desired specifications. This functionality is essential for maintaining consistency across different media formats and optimizing images for various display devices.

Resolutions by Ratio (WLSH) Input Parameters:

aspect

The aspect parameter allows you to select the desired aspect ratio for your image. It offers a range of predefined ratios such as "1:1", "16:9", "4:3", and more. This parameter determines the proportional relationship between the width and height of the image. Choosing the correct aspect ratio is crucial for ensuring that your image fits well within the intended display format.

direction

The direction parameter specifies the orientation of the image, either "landscape" or "portrait". In landscape mode, the width is greater than the height, making it suitable for wide displays. In portrait mode, the height is greater than the width, which is ideal for vertical displays. This parameter helps you tailor the image orientation to match the specific requirements of your project.

shortside

The shortside parameter defines the length of the shorter side of the image in pixels. It accepts integer values with a default of 512, a minimum of 64, and a maximum defined by MAX_RESOLUTION. This parameter is essential for scaling the image while maintaining the chosen aspect ratio. Adjusting the short side length allows you to control the overall size of the image.

Resolutions by Ratio (WLSH) Output Parameters:

width

The width parameter represents the calculated width of the image based on the provided aspect ratio, direction, and short side length. This value is automatically adjusted to ensure it is a multiple of 64, which is often required for compatibility with various image processing tools and frameworks.

height

The height parameter represents the calculated height of the image based on the provided aspect ratio, direction, and short side length. Similar to the width, this value is determined to maintain the specified aspect ratio and orientation.

Resolutions by Ratio (WLSH) Usage Tips:

  • When creating images for social media, use common aspect ratios like "1:1" for Instagram posts or "16:9" for YouTube thumbnails to ensure optimal display.
  • For print media, select aspect ratios that match standard paper sizes, such as "4:3" for photographs or "3:2" for posters.
  • Adjust the shortside parameter to scale your image to the desired size while maintaining the chosen aspect ratio.

Resolutions by Ratio (WLSH) Common Errors and Solutions:

Invalid aspect ratio

  • Explanation: The selected aspect ratio is not in the predefined list.
  • Solution: Ensure you choose an aspect ratio from the provided options: "1:1", "6:5", "5:4", "4:3", "3:2", "16:10", "16:9", "21:9", "43:18", "2:1", "3:1", "4:1".

Invalid direction

  • Explanation: The selected direction is not "landscape" or "portrait".
  • Solution: Verify that the direction parameter is set to either "landscape" or "portrait".

Shortside out of range

  • Explanation: The shortside value is outside the allowed range.
  • Solution: Ensure the shortside value is between 64 and the maximum resolution defined by MAX_RESOLUTION.

Calculation error

  • Explanation: An error occurred during the width and height calculation.
  • Solution: Double-check the input parameters for any inconsistencies and ensure they are within the valid ranges.

Resolutions by Ratio (WLSH) Related Nodes

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