ComfyUI  >  Nodes  >  ComfyUI Easy Use >  Range(Int)

ComfyUI Node: Range(Int)

Class Name

easy rangeInt

Category
EasyUse/Logic/Type
Author
yolain (Account age: 1341 days)
Extension
ComfyUI Easy Use
Latest Updated
6/25/2024
Github Stars
0.5K

How to Install ComfyUI Easy Use

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

Range(Int) Description

Generate customizable integer sequences with precision and flexibility for various numerical operations.

Range(Int):

The easy rangeInt node is designed to generate a sequence of integer values based on specified parameters, making it a versatile tool for creating ranges of numbers in a controlled and customizable manner. This node is particularly useful for tasks that require a series of integer values, such as iterating over a set of indices, generating steps for animations, or creating structured data sets. By allowing you to define the start, stop, and step values, as well as the number of steps and whether the range is inclusive or exclusive, the easy rangeInt node provides a high degree of flexibility and precision in generating integer sequences. This can significantly streamline workflows that involve repetitive numerical operations, ensuring consistency and accuracy in the results.

Range(Int) Input Parameters:

range_mode

The range_mode parameter determines the method used to generate the range of integers. It can be set to either step or num_steps. When set to step, the range is generated by incrementing the start value by the step value until the stop value is reached. When set to num_steps, the range is generated by dividing the interval between the start and stop values into a specified number of steps. This parameter is crucial as it defines the overall approach to creating the range, impacting the distribution and number of values generated.

start

The start parameter specifies the beginning value of the range. This integer value marks the first number in the generated sequence. The choice of the start value directly influences the initial point of the range and can affect the overall length and values included in the sequence. There is no explicit minimum or maximum value for this parameter, but it should be chosen in accordance with the desired range.

stop

The stop parameter defines the end value of the range. This integer value marks the limit up to which the range is generated. Depending on the range_mode and inclusive settings, the stop value may or may not be included in the final sequence. This parameter is essential for determining the endpoint of the range and ensuring that the generated values fall within the desired interval.

step

The step parameter indicates the increment value used when range_mode is set to step. It defines the difference between consecutive values in the range. A positive step value generates an ascending sequence, while a negative step value generates a descending sequence. The step value must be chosen carefully to ensure that the range progresses correctly from the start to the stop value.

num_steps

The num_steps parameter specifies the number of steps to divide the interval between the start and stop values when range_mode is set to num_steps. This parameter determines the total number of values in the generated range, providing control over the granularity of the sequence. It is important to choose an appropriate number of steps to achieve the desired level of detail in the range.

inclusive

The inclusive parameter is a boolean that determines whether the stop value is included in the generated range. When set to true, the stop value is included; when set to false, it is excluded. This parameter allows for precise control over the endpoint of the range, ensuring that the sequence meets specific requirements.

Range(Int) Output Parameters:

ranges

The ranges output parameter is a list of integers representing the generated sequence based on the input parameters. This list contains the values from the start to the stop value, incremented by the step value or divided into the specified number of steps. The ranges output is the primary result of the node, providing the generated integer sequence for further use in various tasks.

range_sizes

The range_sizes output parameter is a list of integers indicating the size of each generated range. This list provides information about the number of values in each range, which can be useful for understanding the distribution and structure of the generated sequences. The range_sizes output helps in analyzing the generated ranges and ensuring they meet the expected criteria.

Range(Int) Usage Tips:

  • Use the step mode for generating ranges with a consistent increment between values, such as creating a sequence of indices or steps for animations.
  • Use the num_steps mode for dividing an interval into a specific number of steps, which is useful for creating evenly spaced values within a range.
  • Set the inclusive parameter to true if you need the stop value to be part of the generated range, ensuring that the endpoint is included in the sequence.

Range(Int) Common Errors and Solutions:

"Invalid step value"

  • Explanation: The step value is set to zero, which would result in an infinite loop.
  • Solution: Ensure that the step value is a non-zero integer to allow the range to progress correctly.

"Mismatched range parameters"

  • Explanation: The start, stop, and step values do not align correctly, causing the range to be empty or incorrect.
  • Solution: Verify that the start, stop, and step values are set appropriately to generate the desired range. Adjust the values to ensure they form a valid sequence.

"Invalid num_steps value"

  • Explanation: The num_steps value is set to a non-positive integer, which is not valid for generating a range.
  • Solution: Ensure that the num_steps value is a positive integer to divide the interval correctly and generate the desired number of steps.

Range(Int) Related Nodes

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