ComfyUI > Nodes > ComfyUI-JNodes > Image Size Selector

ComfyUI Node: Image Size Selector

Class Name

JNodes_ImageSizeSelector

Category
None
Author
JaredTherriault (Account age: 3626days)
Extension
ComfyUI-JNodes
Latest Updated
2024-08-11
Github Stars
0.03K

How to Install ComfyUI-JNodes

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

Image Size Selector Description

Flexible image size selection for AI art projects with predefined and custom dimensions validation.

Image Size Selector:

The JNodes_ImageSizeSelector node is designed to provide flexibility in selecting image sizes for your AI art projects. It allows you to choose from a list of common image sizes or specify custom dimensions if needed. This node ensures that the selected or custom dimensions are valid and suitable for further processing, making it a valuable tool for artists who need precise control over their image dimensions. By using this node, you can easily switch between predefined sizes or input your own, ensuring that your images meet the required specifications for your creative projects.

Image Size Selector Input Parameters:

image_size

This parameter allows you to select a common image size from a predefined list of options. The available sizes include various standard dimensions such as "128x128", "256x256", "512x512", and up to "7680x4320". This selection provides a quick and easy way to choose a commonly used image size without needing to input custom dimensions.

use_custom_size

This boolean parameter determines whether to use a custom image size instead of the selected common size. If set to True, the node will use the values provided in custom_size_x and custom_size_y to define the image dimensions. The default value is False.

custom_size_x

This integer parameter specifies the custom width of the image when use_custom_size is enabled. The value must be greater than or equal to 2. If the value is less than 2, it will be adjusted based on the value of custom_size_y if it is valid. The default value is 512.

custom_size_y

This integer parameter specifies the custom height of the image when use_custom_size is enabled. The value must be greater than or equal to 2. If the value is less than 2, it will be adjusted based on the value of custom_size_x if it is valid. The default value is 512.

flip_width_and_height

This boolean parameter allows you to flip the width and height values. If set to True, the width and height values will be swapped. This can be useful for quickly changing the orientation of the image dimensions. The default value is False.

Image Size Selector Output Parameters:

width

This output parameter represents the width of the image after processing the input parameters. It ensures that the width is valid and greater than or equal to 2, providing a suitable dimension for further image processing.

height

This output parameter represents the height of the image after processing the input parameters. It ensures that the height is valid and greater than or equal to 2, providing a suitable dimension for further image processing.

Image Size Selector Usage Tips:

  • Use the image_size parameter to quickly select a common image size for standard projects, saving time on manual input.
  • Enable use_custom_size when you need specific dimensions that are not available in the predefined list, ensuring your image meets unique requirements.
  • Utilize the flip_width_and_height parameter to easily switch between landscape and portrait orientations without manually adjusting the dimensions.

Image Size Selector Common Errors and Solutions:

ImageSizeSelector::return_size: x and y values should be greater than 0!

  • Explanation: This error occurs when the custom dimensions provided are less than 2 for both width and height.
  • Solution: Ensure that both custom_size_x and custom_size_y are set to values greater than or equal to 2. If one of the dimensions is invalid, it will be adjusted based on the other valid dimension if possible.

Image Size Selector Related Nodes

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