π§ͺ Laboratory
A number generator with a memory, for when randomness has to behave
- frame_counter
- FLOAT
- INT
- log_entry
Most random-value nodes in ComfyUI are dumb in a specific way: they give you a number and forget everything. Laboratory [Dream] is the opposite. The README calls it a "super-charged number generator for experimenting," and the supercharge is memory - it can produce a random value once and then reuse that exact value for the rest of the run, or roll a new one every single frame, and it remembers what it produced even across runs of the graph. That makes it genuinely useful for animation, where you often want a parameter that's random but stable, or stable-but-varying on a schedule.
Here's the mechanism. You give the node a key (a string that names this particular value), a seed, a min_value/max_value range, and a mode. Every time it runs it checks its state store: if this is the first frame, or renew_policy is "every frame," it generates a new value with that seed and stores it under the key. Otherwise it returns the stored value. The mode decides how random: random uniform is a flat pick, random bell averages three uniform draws so values cluster around the middle, ladder steps up by step_size (wrapping around), and random walk takes a small step up or down each time. Because the state is persisted to disk, a "first frame" value survives between runs - same graph, same key, same number, which is great when you want reproducibility without hardcoding.
The inputs that matter
- frame_counter - required; it decides what "first frame" and "every frame" mean.
- key - the identity of this value. Change it and you get a fresh, independent value. The default is a random name, so two Laboratory nodes default to unrelated values.
- mode - random uniform / random bell / ladder / random walk. The one beginners underestimate is
ladder: it's not random at all, it's a counter that climbs bystep_sizeand wraps. - renew_policy - "every frame" for a constantly changing value, "first frame" for one random value held steady.
- step_size - only used by ladder and random walk (optional).
It outputs FLOAT, INT, and a log_entry (so you can tee it straight into the pack's logging chain).
Installing it
Install via ComfyUI Manager - search "Dream Project Animation Nodes" - or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-project.git
cd comfyui-dream-project
pip install -r requirements.txt
Restart ComfyUI. The pack's numpy<2.0 pin is the only install gotcha worth remembering.
Common issues
The one thing that trips people is expecting the state to reset. Because Laboratory persists its per-key value to disk, a value you think is fresh may be the same one from a previous run - that's a feature, but only when you understand it. Change the key or the seed to force a new value. And if you want truly different values from two instances, change the default key (it includes a random number, but that default is baked in at node creation). Also note the pack is declared unmaintained in its README - fine for this node, it's stable and small.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| frame_counter | FRAME_COUNTER | β | |
| key | STRING | Random value 804654 | β |
| seed | INT | 00β18446744073709550000 | β |
| renew_policy | COMBO | 2 options: every frame, first frame | |
| min_value | FLOAT | 0.00 | β |
| max_value | FLOAT | 1.00 | β |
| mode | COMBO | 4 options: random uniform, random bell, ladder, random walk | |
| step_sizeopt | FLOAT | 0.10 | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | β |
| INT | INT | β |
| log_entry | LOG_ENTRY | β |