Nodes/ComfyUI-mnemic-nodes/🎲 Random Bool
ComfyUI Node

🎲 Random Bool

Random Bool β€” ComfyUI Node Guide

By MNeMoNiCuZΒ·Created 3 years agoΒ·Updated 23 days agoΒ· 105
🎲 Random Bool
    • random_bool
    β—„true_probability0.50β–Ί
    β—„seed-1β–Ί

    A weighted coin flip, wired as a node. The straightforward use is toggling something on or off randomly between runs - feeding a Boolean-gated bypass elsewhere in your graph, deciding whether a particular LoRA or wildcard branch fires this generation, or randomizing any other on/off decision you'd otherwise have to click by hand every time.

    Inputs: true_probability, required, defaults to 0.5 for a genuine coin flip, but the real value of this node over just eyeballing a 50/50 is that you can dial it away from even odds - set it to 0.1 and you get an event that's rare but still present, like occasionally adding a hat or occasionally swapping to a different style, rather than something that shows up in half your generations. Push it toward 0.9 instead and you get the opposite: an option that's true almost always, with just enough room for the occasional exception. seed is optional, following the same convention as the rest of this pack: -1 (default) rolls genuinely fresh every run, a fixed value locks in a reproducible result.

    Output: a single random_bool.

    There's no separate "false probability" input to worry about - it's implicitly whatever's left over after true_probability, so you only ever have to think in terms of the outcome you actually care about being present.

    It sits alongside Random Int in Range, Random Float in Range, and Random Color as the pack's set of "roll a value instead of typing one" nodes - same seed convention, same idea, just a different type coming out the other end. If you're wiring several of these into one workflow and want them to roll independently rather than all landing on the same run-to-run pattern, give each a different seed rather than sharing one across all of them.

    Installing it: ComfyUI Manager, search "ComfyUI-mnemic-nodes," or cd ComfyUI/custom_nodes && git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes, then restart. Zero dependencies beyond Python itself.

    There's not much to troubleshoot on a node this small, which is the point of it - one required field, one optional one, one output. The only thing worth double-checking if it seems to be returning the "same" result over and over is, as with every randomizer in this pack, whether ComfyUI's Control After Generate is actually set to Increment or Randomize on the seed - left on Fixed, you'll get the identical roll every single time, which looks like a broken node rather than a static seed doing exactly what it's configured to do. If you're not sure the wiring downstream is actually reacting to it, connect the output to a Preview text node temporarily and confirm you're seeing both true and false show up across a few queue runs before you trust it inside a bigger graph.

    Category⚑ MNeMiC Nodes

    Inputs (2)

    NameTypeDefaultDescription
    true_probabilityFLOAT0.500–1Probability of returning True (0.0 = always False, 1.0 = always True, 0.5 = 50/50).
    seedoptINT-1-1–18446744073709550000Seed for random number generator. Use -1 for random seed (different each time), or set a specific value for reproducibility.

    Outputs (1)

    NameTypeDescription
    random_boolBOOLEANβ€”