Probability Gate
A seeded coin flip you can wire into your graph logic
- BOOLEAN
Probability Gate is a weighted coin flip that outputs a BOOLEAN you can wire into anything conditional in your graph - a switch node, a branch, a bypass toggle. Set probability to 0.3 and, roughly 30% of the time, it returns true; the rest of the time, false. It's the node for "sometimes do this, sometimes don't" logic without writing an actual script node.
Ships in aria1th's ComfyUI-LogicUtils, a personal utility pack from the trainer behind Illustrious XL - a mixed bag of math, string, and logic helpers that's thin on documentation but does what its node names promise. This one is marked as an output node in the schema, so its result surfaces directly rather than only ever being consumed silently downstream.
Why you'd reach for it
Anywhere you want stochastic variation in a workflow that isn't naturally covered by ComfyUI's existing randomization (seeds, random samplers): randomly enabling a LoRA on some fraction of batch runs, occasionally skipping an optional processing step to compare with/without, or driving A/B-style branching where you want a controlled mix rather than a fixed always-on or always-off path. Pair it with a Switch/If-style node that reads its BOOLEAN output to actually gate execution.
How it works
It's a seeded Bernoulli draw: with probability probability, output True; otherwise False. The seed input makes it deterministic and repeatable - the same seed at the same probability always produces the same true/false result, which matters if you're trying to reproduce a specific run exactly rather than get fresh randomness every time.
Inputs and outputs
probability(FLOAT, default 0.5, range 0–1) - the chance of aTrueresult. 0 always returns false, 1 always returns true, 0.5 is a fair coin flip.seed(INT, default 0) - controls the draw. Same seed and probability → same result, every run.- Output:
BOOLEAN- true or false, per the draw above. Wire it into whatever conditional logic node reads booleans in your graph.
How to install it
ComfyUI Manager: search "ComfyUI-LogicUtils", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
then restart. No models involved - a trivial CPU-side probability check.
Common issues & troubleshooting
"Missing node type" on a shared workflow. ComfyUI Manager's "Install Missing Custom Nodes" installs the whole pack from the graph JSON in one pass.
Import error at startup. Per the README, the pack's dependency auto-installer is opt-in: set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 before launch to let it install what's needed, or COMFYUI_LOGICUTILS_SKIP_INSTALL=1 to disable that hook if it's the actual culprit. ProbabilityGate needs nothing beyond the standard library.
Same true/false every single run. That's seed doing exactly what it's supposed to - fixed seed, fixed probability, fixed outcome. If you want the gate to actually vary run to run, randomize the seed input rather than leaving it at a constant.
Output doesn't seem to be gating anything. ProbabilityGate only produces the boolean - it doesn't itself stop or skip execution of anything downstream. You need a separate conditional/switch node reading its BOOLEAN output to actually branch or bypass part of your graph based on it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| probability | FLOAT | 0.500–1 | — |
| seed | INT | 00–9223372036854776000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |