ComfyUI > Nodes > ComfyUI-LogicUtils > Uniform Random Choice

ComfyUI Node: Uniform Random Choice

Class Name

UniformRandomChoice

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 Choice Description

Randomly selects an item from a list with equal probability, useful for unbiased randomness.

Uniform Random Choice:

The UniformRandomChoice node is designed to randomly select an item from a list of options, ensuring each option has an equal probability of being chosen. This node is particularly useful in scenarios where you need to introduce randomness into your workflow, such as selecting random elements for creative projects or simulations. By providing a uniform distribution, it ensures that each choice is equally likely, which can be beneficial for maintaining fairness or exploring a wide range of possibilities without bias. This node is a valuable tool for AI artists looking to incorporate stochastic elements into their work, allowing for dynamic and varied outputs.

Uniform Random Choice Input Parameters:

options

The options parameter is a list of items from which the node will randomly select one. Each item in the list has an equal chance of being chosen, making this parameter crucial for defining the pool of potential outcomes. The list can contain any type of elements, such as numbers, strings, or objects, depending on the context in which the node is used. There is no explicit minimum or maximum number of items required, but having a diverse set of options can enhance the randomness and variability of the results.

seed

The seed parameter is an integer that initializes the random number generator, ensuring reproducibility of results. By setting a specific seed value, you can achieve consistent outcomes across multiple runs, which is useful for debugging or when you need to replicate a particular random selection. The default value is typically 0, but you can choose any integer within the range of 0 to 2^63-1. Using different seed values will result in different random selections, allowing for varied outputs.

Uniform Random Choice Output Parameters:

selected_option

The selected_option is the item chosen from the list of options provided as input. This output represents the result of the random selection process and is the primary outcome of using the UniformRandomChoice node. The selected option can be any type of element that was included in the input list, and its value is determined by the uniform random selection process. This output is essential for integrating randomness into your workflow, as it provides the dynamically chosen element based on the specified parameters.

Uniform Random Choice Usage Tips:

  • To ensure reproducibility of your random selections, use a fixed seed value. This allows you to achieve consistent results across different runs, which is particularly useful for testing and debugging.
  • Experiment with different lists of options to explore a wide range of outcomes. By varying the elements in your input list, you can introduce more diversity and creativity into your projects.

Uniform Random Choice Common Errors and Solutions:

"List of options is empty"

  • Explanation: This error occurs when the options parameter is an empty list, meaning there are no items to choose from.
  • Solution: Ensure that the options parameter contains at least one item. Add elements to the list to provide a valid pool of choices for the node to select from.

"Invalid seed value"

  • Explanation: This error arises when the seed parameter is set to a non-integer value or is outside the acceptable range.
  • Solution: Verify that the seed parameter is an integer within the range of 0 to 2^63-1. Adjust the seed value accordingly to ensure it is valid.

Uniform Random Choice 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.