A simple and efficient custom node for ComfyUI that generates random numbers between two user-selectable values. Perfect for seed variation, parameter randomization, and workflow experimentation.
- 🎲 Generate random integers and floats simultaneously
- 🔄 Seed control for reproducible results
- 📊 User-selectable min/max range with decimal support
- ⚡ Lightweight - uses only Python standard library
- 🎯 Appears in Logic/Math category for easy access
- Open ComfyUI Manager in your ComfyUI interface
- Search for "Random Number"
- Click Install
- Restart ComfyUI
-
Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/ -
Clone this repository:
git clone https://github.com/warfy5/ComfyUI-RandomNumbers.git
-
Restart ComfyUI
- Method 1: Double-click on the canvas and search for "Random Number"
- Method 2: Right-click → Logic → Math → Random Number
| Input | Type | Default | Description |
|---|---|---|---|
min_value |
FLOAT | 0.0 | Minimum value (inclusive) |
max_value |
FLOAT | 999999.0 | Maximum value (inclusive) |
seed |
INT | 0 | Random seed for reproducibility |
| Output | Type | Description |
|---|---|---|
int |
INT | Integer random value |
float |
FLOAT | Float random value |
1. Random Seed Generation
- Set min=0, max=9999999
- Use the
intoutput to feed into KSampler seed inputs - Change the node's seed parameter to get different random seeds
2. Parameter Variation
- Set min=0.5, max=1.5 for denoise strength variation
- Set min=5.0, max=15.0 for CFG scale randomization
- Use the
floatoutput for continuous parameters
3. Reproducible Randomness
- Set a specific seed value (e.g., 42)
- Same seed always produces the same random number
- Perfect for reproducible workflows and testing
The node uses Python's built-in random module with seed control:
- If
min_value > max_value, they are automatically swapped - The seed is set for reproducible randomization
- A float value is generated using
random.uniform() - An integer value is created by converting the float
- Both values are output simultaneously
- ComfyUI
- Python 3.8 or higher
- No additional dependencies required
Node doesn't appear in menu:
- Check that the folder is in
ComfyUI/custom_nodes/ - Verify the folder name is
ComfyUI-RandomNumber - Restart ComfyUI completely
- Check console for any Python errors
Getting the same number every time:
- This is expected behavior when using the same seed
- Change the
seedparameter to get different results - The seed parameter is what makes results reproducible
- Initial release
- Basic random number generation with int/float outputs
- Seed control for reproducibility
- Min/max range selection
Contributions are welcome! Please feel free to submit a Pull Request.
Do whatever you want with it licence. Thanks for checking though.
Created for the ComfyUI community.
If you encounter any issues or have suggestions:
- Open an issue on GitHub
- Check existing issues for solutions