πΎ Boolean Input Value Switch
Turn a float into a yes/no decision
- boolean
Say you've got a seed or a random float in your graph and you want to branch on it: "if this value lands above 0.5, take the cinematic route, otherwise go flat." Normally that's a little dance with math nodes and a comparison. Boolean Input Value Switch does it in one node by mapping an input float to a true/false output, based on which of two ranges the value falls into. It's a threshold, but a properly opinionated one.
How it works
You define two ranges: a true range and a false range, each as a min/max pair:
true_min/true_max(defaults 0.51β1.0)false_min/false_max(defaults 0.0β0.5)
The incoming FLOAT_input gets tested against both. If it's in the true range you get true; in the false range you get false. The defaults are set up so anything 0β0.5 is false and 0.51β1.0 is true, which is a natural mapping for a 0β1 random value.
The genuinely clever part is overlap_behavior. Real values don't always play nice, so when a value lands in both ranges you get three options:
- randomize - flip a coin each run.
- force_true / force_false - break the tie deterministically.
Note that "randomize" re-evaluates on every queue run, so it's genuinely random per run rather than cached. If you want a stable decision from a fixed seed, pick one of the force modes or widen your ranges so there's no overlap.
Inputs you'll actually set
The FLOAT_input is the only required data input - and it's forceInput, meaning it must arrive on a wire (you can't just type a number). Set the four range values to carve out your decision boundary. That's the whole surface area: five numbers and a behavior dropdown, one boolean out.
Where it fits
The output is a BOOLEAN, which slots straight into the pack's other switch nodes - Boolean Switch Value Output to pick a number, Boolean Master Switch to fan out a decision, or any node with a boolean input. It's niche, but for anyone building "choose a path based on a generated value" logic without writing a custom node, it's the missing link.
Install
Part of MachinePainting Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/machinepainting/ComfyUI-MachinePaintingNodes.git
pip install -r requirements.txt
Or ComfyUI Manager β search "MachinePaintingNodes" β install β restart.
Gotchas
The quiet trap is range math you don't notice: if your true and false ranges overlap and you've left overlap_behavior on randomize, the same value can flip-flop between runs and you'll swear the graph is haunted. That's the tooltip's whole warning - "what to do when value falls in both ranges" - and it's worth resolving deliberately. Also, values outside both ranges default to false, so a float of 2.0 with the default ranges reads as false, not true. Set your bounds accordingly.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| FLOAT_input | FLOAT | β | |
| true_min | FLOAT | 0.51-9999β9999 | β |
| true_max | FLOAT | 1.00-9999β9999 | β |
| false_min | FLOAT | 0.00-9999β9999 | β |
| false_max | FLOAT | 0.50-9999β9999 | β |
| overlap_behavior | COMBO | randomize | What to do when value falls in both ranges |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| boolean | BOOLEAN | β |