Random Number Sampler π²
A random number between min and max β displayed on the node, served three ways
- sampled_int
- sampled_float
- sampled_string
Eden_RandomNumberSampler draws a uniform random number between min_value and max_value and shows it to you right on the node - it's an output node, so the sampled value renders in the UI after each run. And it hands you the number as an int, a float, and a string, so whatever your downstream node expects, there's a matching socket. This is the "give me variety that I can still reproduce" node for seeds, strengths, and dimensions.
How it works
It seeds PyTorch and Python's random with your seed, samples uniformly between the min and max (swapping them if you accidentally set min above max - a thoughtful touch), and rounds to two decimals. The rounded float becomes the canonical value, the int output is that value rounded to a whole number, and the string is the float formatted to two places. Being an output node, it also pushes the number to the UI so you can see what got sampled instead of guessing from downstream results.
Inputs
- seed (
INT, default 0) - reproducibility. - min_value (
FLOAT, β1000 to 1000) and max_value (FLOAT, β1000 to 1000) - the range. Defaults 0β1.
Outputs: sampled_int, sampled_float, sampled_string.
What it's good for
Anywhere you want controlled randomness. Sample a seed range and feed the int into a KSampler for varied-but-reproducible images. Sample a denoise range and feed the float into a strength input. Drive dynamic resolutions with Eden_Math on top. The string output is the sleeper: feed it into a text node to log what was sampled, or build a filename. Because it's a clean uniform sample per run, it slots neatly into batch-variety loops - same seed reproduces the same draw, which is the property that keeps a batch run debuggable.
Installing it
Part of the Eden.art nodesuite (edenartlab/eden_comfy_pipelines). Install via ComfyUI Manager (search "Eden.art nodesuite") or:
cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/eden_comfy_pipelines
cd eden_comfy_pipelines && pip install -r requirements.txt
Restart ComfyUI.
Common issues
The int output is a rounded float, not a fresh integer sample - if you need an integer in a specific range, use the int socket but expect it to behave like round(uniform sample). That's usually fine and sometimes not; for discrete integer selection a plain random int node is more honest. Also: the two-decimal rounding means tiny ranges (like 0 to 0.001) collapse to very few distinct values - widen the range if you're not seeing variety. And remember the seed is yours to manage; without changing it, every run draws the same number, which surprises people the first time.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00β18446744073709550000 | β |
| min_value | FLOAT | 0.00-1000β1000 | β |
| max_value | FLOAT | 1.00-1000β1000 | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| sampled_int | INT | β |
| sampled_float | FLOAT | β |
| sampled_string | STRING | β |