Nodes/WebApp API/Random number generator
ComfyUI Node

Random number generator

The pack's easiest seed source

By MonkeyProof-Solutions-BV·Created 6 months ago·Updated 3 months ago· 2
Random number generator
  • iterate
  • Random float
  • Random int
min0.00
max1.00

A random number in a range, in two flavors, with a list-friendly twist. WebApp_Randomnumbergenerator is one of the ComfyUI_webapp pack's helper nodes - it has nothing to do with web apps. It's a tiny utility that rolls a random float and a random int between the min and max you set, and it's honestly the most useful 20-line node in the pack for daily ComfyUI use. Wire it into a seed input and you've got a fresh seed every run.

The inputs

  • min (FLOAT, default 0) - lowest allowed value.
  • max (FLOAT, default 1) - highest allowed value.
  • iterate (*, optional) - the interesting one. Connect any list here and you get a new random number for each item in that list, matching its length. This is the pack leaning on ComfyUI's list processing again: one node, and a batch of seeds comes out the other end.

The outputs

  • Random float (FLOAT, a list) - random.uniform(min, max), i.e. continuous decimals.
  • Random int (INT, a list) - the float rounded to a whole number. So between 0 and 1 you'll get either 0 or 1; between 0 and 10 you'll get integers from 0 to 10.

Both outputs are lists, which is why iterate works the way it does - feed a list, get a list back of the same length, one number per item.

When you'd actually use it

Seeds, mostly. Wire Random int into a sampler's seed input (after converting to an input) and every run gets a new seed without the "randomize" control_after_generate dance. Or keep it in a batch workflow: connect a list of prompts to iterate and each prompt gets its own random number, which downstream can drive seed or strength per item. It's a small node with exactly one job, and it does it cleanly.

Installing it

Same one-time install as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/MonkeyProof-Solutions-BV/ComfyUI_webapp

Restart ComfyUI, or use ComfyUI Manager → search ComfyUI_webapp ("WebApp API"). No models, no downloads; dependencies are pillow and torch, both standard.

Gotchas

The int output is the rounded float, not an independent draw - if you want a random integer in a range, just set min/max to your range and read Random int; don't expect two independent random values from one run. And the usual pack note: it's written against the newer backend node API (comfy_api.latest), so a stale ComfyUI won't register it - update ComfyUI if the nodes are missing.

Categoryrandom

Inputs (3)

NameTypeDefaultDescription
minFLOAT0.00Lowest allowed value.
maxFLOAT1.00Highest allowed value.
iterateopt*Connect any list to get a new random number for each item in the list.

Outputs (2)

NameTypeDescription
Random floatFLOAT
Random intINT