π² Random Float in Range
Random Float in Range β ComfyUI Node Guide
- random_float
A dice roll for any decimal number, wired as an actual node instead of a slider you set by hand. The obvious use is randomizing something like CFG, denoise strength, a LoRA weight, or an upscale factor across a batch or between runs - anywhere you'd normally type a fixed float into a widget, you can instead convert that widget to an input and wire this node in to get a different value every time (or the same value every time, deliberately, with a fixed seed).
Inputs: min_value and max_value set the inclusive range the result can fall in - both accept a huge span, positive or negative, so this works just as well for something like a signed offset as it does for a 0β1 strength value. decimals controls rounding: leave it at the default -1 for full floating-point precision, or set it to something like 2 if you're feeding a widget where fifteen decimal places of noise is meaningless (a denoise value, say, where anything past the hundredths place doesn't change the output). seed follows the pack's usual convention: -1 (the default) gives you a genuinely different result every run, and any other value locks in reproducibility - useful once you've found a randomized value that worked well and want to pin it down.
Output: a single random_float, ready to convert-to-input on whatever widget you're targeting.
A concrete example of where this earns its keep: say you're testing how a LoRA behaves across a range of strengths without manually nudging a slider and re-queueing twenty times. Set min_value to 0.4, max_value to 1.2, decimals to 2, leave seed at -1, and queue a batch - every run lands somewhere different in that range, and you can eyeball the results afterward for the sweet spot instead of guessing at it one value at a time. It's the same idea as this pack's Random Int in Range node, just for the continuous values ComfyUI uses far more often than whole numbers - CFG, denoise, and strength sliders are almost always floats, not integers.
Installing it: ComfyUI Manager, search "ComfyUI-mnemic-nodes," or the manual route, cd ComfyUI/custom_nodes && git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes, then restart ComfyUI. It's a tiny, dependency-free node - there's genuinely nothing here that can conflict with anything else installed.
There isn't much of a troubleshooting section for a node this small, and that's a feature rather than a gap - it does exactly one thing with two required numbers and two optional knobs. The one honest failure mode to watch for is the same one that trips people up on every "seed drives randomness" node in this pack: forgetting to set ComfyUI's Control After Generate to Increment (or Randomize) if you want a genuinely new value each run rather than the same one repeating because the seed never moved. Beyond that, plug the output into any float widget you've converted to an input and it just works - no models, no API keys, nothing external to fail.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| min_value | FLOAT | 0.000-10000000000β10000000000 | Minimum value for the random float (inclusive). |
| max_value | FLOAT | 1.000-10000000000β10000000000 | Maximum value for the random float (inclusive). |
| decimalsopt | INT | -1-1β10 | Number of decimal places to round to. Use -1 for no rounding (full precision). |
| seedopt | INT | -1-1β18446744073709550000 | Seed for random number generator. Use -1 for random seed (different each time), or set a specific value for reproducibility. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| random_float | FLOAT | β |