FERandomBool
A coin flip you can actually seed
- bool
Randomness is the soul of image generation, but sometimes you want randomness that's controllable: "this run, 70% of the time do A, otherwise do B - and let me reproduce a given outcome by pinning a seed." That's the whole job of FERandomBool. It flips a weighted coin and hands you a boolean. Nothing more, and honestly nothing less is needed.
It lives in the fexli/utils menu and slots into the same family as the pack's other random helpers - random colors, random prompts, random LoRA selection. If you're building a "surprise me" workflow that randomizes prompts, checkpoints, or post-processing on every run, this is the decision node at the top of it all.
Inputs and output
true_prob- the probability oftrue, a float from0.0to1.0, default0.5. Set0.9and the node returns true nine times out of ten.seed- the reproducibility dial. The same seed andtrue_probalways produce the same flip, every single time.
Output: bool, a BOOLEAN. Wire it into anything that takes a boolean - an FEOperatorIf condition, an input marked as force-input, a FEInterruptCondition if you want a random chance of bailing out.
The details that matter
Two things make this node better than rigging your own randomness:
First, it's an always-change node (IS_CHANGED returns NaN), so ComfyUI doesn't cache its output between queue runs. This is the trap with naive random nodes - you set a seed, run once, and every subsequent run gives the same "random" result because the node's cached. FERandomBool re-rolls every execution, which is what you actually want when the point is variety. If you do want a stable flip across runs, just pin the seed.
Second, the seed path is clean: it seeds an internal Random instance with your seed and compares random() < true_prob. Deterministic given the same seed - no interference from other random calls in your process.
Where to use it
The classic pattern: pair it with FEOperatorIf to swap between two prompts, two denoise strengths, or two output paths on a coin flip. Or gate a FERandomLoraSelect so a workflow only applies style LoRAs sometimes. It's a utility, so there's no "right" workflow - it's the node you reach for whenever a graph needs a decision that's partly luck and partly on purpose.
Install
Part of fexli-util-node-comfyui:
cd ComfyUI/custom_nodes
git clone https://github.com/fexli/fexli-util-node-comfyui
cd fexli-util-node-comfyui
pip install -r requirements.txt
Or via ComfyUI Manager (search fexli-util-node-comfyui), then restart. Light dependencies, no model files, no config.yaml.
If you've ever wished a workflow would just sometimes do the interesting thing, this is the node that makes "sometimes" a seedable number.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| true_prob | FLOAT | 0.500–1 | — |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| bool | BOOLEAN | — |