ComfyUI Extension
ComfyUI-RandomSwitch
A ComfyUI custom node that randomly selects one input from multiple inputs of the same type.
tttamaki/ComfyUI-RandomSwitch
Nodes—
On cloudLocal install
Stars0
Updated30 days ago
Readme
ComfyUI Random Switch
A ComfyUI custom node that randomly selects one input from multiple inputs of the same type.
Features
- Random Selection: Randomly pick one value from 2-32 inputs
- Flexible Input Types: Accepts any type (images, latents, conditioning, etc.) as long as all inputs are the same type
- Seed Control: Use an external seed for reproducible results, or auto-generate a seed on each run
- Dynamic Input Growth: UI automatically expands to show the next input when all current inputs are connected
Installation
-
Clone or download this repository into your ComfyUI
custom_nodesdirectory:cd ComfyUI/custom_nodes git clone https://github.com/tttamaki/Comfyui-RandomSwitch.git -
Restart ComfyUI
Usage
Basic Setup
- Add the Random Switch node to your workflow (search for "Random Switch")
- Connect 2 or more inputs (images, latents, etc.) - all must be the same type
- The node will randomly select and output one of the connected inputs
With Seed Control
- Leave seed at
0to get a random selection each run - Connect a seed value for reproducible results (same seed = same selection)
- The node outputs both the selected value and the seed used
Example Workflows
- Random Image Selection: Connect multiple images and randomly pick one
- Random Latent Selection: Use with latent inputs for probabilistic sampling
- Random Conditioning: Switch between different conditioning inputs
Inputs
- inputs (Autogrow): 2-32 inputs of any type (must all be the same type)
- seed (Int): Random seed for reproducibility (0 = auto-generate)
Outputs
- output (Any): The randomly selected input value
- seed (Int): The seed value that was used
License
MIT License
Author
tttamaki and GitHub Copilot