Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI_SamplingUtils > Random Integer in Range

ComfyUI Node: Random Integer in Range

Class Name

IntegerRangeRandom

Category
utils/primitive
Author
silveroxides (Account age: 2211days)
Extension
ComfyUI_SamplingUtils
Latest Updated
2026-06-03
Github Stars
0.02K

How to Install ComfyUI_SamplingUtils

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

Run ComfyUI Online

Random Integer in Range Description

Generate random integers within specified range for variability and unpredictability, with seed value for reproducibility.

Random Integer in Range:

The IntegerRangeRandom node is designed to generate a random integer within a specified range, providing a simple yet powerful tool for introducing variability and randomness into your projects. This node is particularly useful when you need to create dynamic and unpredictable elements, such as randomizing parameters or generating unique identifiers. By leveraging a seed value, the node ensures that the sequence of random numbers can be reproduced, which is essential for consistency in iterative processes or when sharing results with others. The primary goal of this node is to offer a straightforward method for generating random integers, making it an invaluable asset for AI artists looking to add a touch of randomness to their creative workflows.

Random Integer in Range Input Parameters:

minimum

The minimum parameter defines the lower bound of the range from which the random integer will be selected. It ensures that the generated number will not be less than this value. The parameter accepts any integer value from -sys.maxsize to sys.maxsize, providing flexibility to accommodate a wide range of applications. Setting an appropriate minimum value is crucial for controlling the lower limit of the randomness introduced by this node.

maximum

The maximum parameter sets the upper bound of the range for the random integer generation. It guarantees that the generated number will not exceed this value. Like the minimum parameter, it accepts integer values from -sys.maxsize to sys.maxsize. Choosing the right maximum value is essential for defining the upper limit of the randomness, allowing you to tailor the range to your specific needs.

seed

The seed parameter is used to initialize the random number generator, ensuring that the sequence of random numbers can be reproduced. This is particularly useful when you need consistent results across different runs or when sharing your work with others. The seed can be any integer value from -sys.maxsize to sys.maxsize. By controlling the seed, you can achieve repeatability in your random number generation, which is vital for debugging and iterative design processes.

Random Integer in Range Output Parameters:

random_integer

The random_integer output parameter provides the randomly generated integer within the specified range. This output is the result of the node's execution and represents the core functionality of the IntegerRangeRandom node. The value of random_integer is determined by the minimum, maximum, and seed input parameters, and it serves as a versatile element that can be used in various creative and computational contexts to introduce randomness and variability.

Random Integer in Range Usage Tips:

  • To ensure reproducibility of results, always use a fixed seed value when generating random integers for iterative processes or when sharing your work with others.
  • When defining the minimum and maximum parameters, ensure that minimum is less than or equal to maximum to avoid unexpected behavior or errors.
  • Utilize the node to introduce controlled randomness in your projects, such as randomizing visual elements or generating unique identifiers.

Random Integer in Range Common Errors and Solutions:

ValueError: empty range for randrange()

  • Explanation: This error occurs when the minimum value is greater than the maximum value, resulting in an invalid range for random number generation.
  • Solution: Ensure that the minimum parameter is less than or equal to the maximum parameter to define a valid range for random integer generation.

TypeError: an integer is required

  • Explanation: This error may arise if non-integer values are provided for the minimum, maximum, or seed parameters.
  • Solution: Verify that all input parameters are integers and within the specified range to prevent type-related errors.

Random Integer in Range Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_SamplingUtils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Random Integer in Range