ComfyUI > Nodes > ComfyUI-LogicUtils > Uniform Random Int

ComfyUI Node: Uniform Random Int

Class Name

UniformRandomInt

Category
Logic Gates
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

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

Uniform Random Int Description

Generates a random integer within a specified range, ensuring equal probability for each value.

Uniform Random Int:

The UniformRandomInt node is designed to generate a random integer within a specified range, providing a simple yet powerful tool for introducing randomness into your projects. This node is particularly useful when you need to select a random integer between two values, ensuring that each possible integer within the range has an equal chance of being chosen. If the minimum value specified is greater than the maximum value, the node gracefully defaults to the minimum value, ensuring robust and predictable behavior. This functionality is essential for applications requiring randomization, such as procedural content generation, simulations, or any scenario where variability is desired.

Uniform Random Int Input Parameters:

min_val

The min_val parameter specifies the lower bound of the range from which the random integer will be selected. It determines the smallest possible integer that can be generated by the node. The minimum value for min_val is -999,999,999, and the maximum is 999,999,999, with a default value of 0. This parameter is crucial as it sets the starting point of the random selection range.

max_val

The max_val parameter defines the upper bound of the range for the random integer selection. It sets the largest possible integer that can be generated. The minimum value for max_val is -999,999,999, and the maximum is 999,999,999, with a default value of 1. This parameter is important because it establishes the endpoint of the random selection range.

seed

The seed parameter is used to initialize the random number generator, ensuring reproducibility of results. By providing a specific seed value, you can generate the same sequence of random numbers across different runs. The minimum value for seed is 0, and the maximum is 2^63-1, with a default value of 0. This parameter is essential for scenarios where consistent results are needed, such as testing or debugging.

Uniform Random Int Output Parameters:

INT

The output parameter is an integer (INT) that represents the randomly selected value from the specified range. This integer is the result of the random selection process and is crucial for any application or process that requires a random integer input. The output is a single integer value that falls within the defined min_val and max_val range, providing the randomness needed for your application.

Uniform Random Int Usage Tips:

  • To ensure reproducibility of random numbers, use a specific seed value. This is particularly useful for debugging or when you need consistent results across different runs.
  • When setting min_val and max_val, ensure that min_val is less than or equal to max_val to avoid unexpected behavior. If min_val is greater, the node will default to returning min_val.

Uniform Random Int Common Errors and Solutions:

"min_val is greater than max_val"

  • Explanation: This error occurs when the min_val parameter is set to a value greater than the max_val parameter.
  • Solution: Ensure that the min_val is less than or equal to max_val. Adjust the values accordingly to define a valid range for random integer selection.

"Invalid seed value"

  • Explanation: This error might occur if the seed value is set outside the acceptable range.
  • Solution: Verify that the seed value is within the range of 0 to 2^63-1. Adjust the seed value to fall within this range to ensure proper initialization of the random number generator.

Uniform Random Int Related Nodes

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