Integer to Boolean Values JM
Turn a Number Into 10 On/Off Switches for Combinatorial Prompts
- BOOLEAN
- BOOLEAN
- BOOLEAN
- BOOLEAN
- BOOLEAN
- BOOLEAN
- BOOLEAN
- BOOLEAN
- BOOLEAN
- BOOLEAN
The name undersells it. "Integer to Boolean Values JM" is the clever core of a trick that lets you generate every combination of a set of prompt fragments - 1024 different prompts from one slider, no randomness involved. Feed it an integer and it hands you ten boolean outputs, each one a bit of that number in binary. Wire those booleans into the pack's Switchable Prompt JM nodes and each bit becomes an on/off switch for one fragment of your prompt.
Why would you bother? ComfyUI's built-in {option1|option2} syntax picks one option per run, and it's random-ish - fine for variety, useless when you want to systematically sweep every combination and compare. This pack's whole idea is that a number is a set of switches. 0 through 1023 cover every possible on/off arrangement of ten switches, so enumerating the integers enumerates every combination. That's a deterministic, reproducible sweep you can batch and diff, not a dice roll.
How it works
The node takes your input_integer, converts it to binary, reverses the digits so the least significant bit comes first, and pads to ten. So 5 (binary 101) gives you outputs of True, False, True, False, False, False, False, False, False, False - the 1-bit is on, the 4-bit is on, the 2-bit is off. Output 1 is the 1's place, output 2 is the 2's place, and so on up to output 10, which is the 512's place. The max: 1023 cap isn't arbitrary: ten bits is all this node has, so that's the biggest number it can represent.
The inputs and outputs that matter
You only set one thing:
- input_integer - an
INTfrom 0 to 1023, default 0, step 1. That's the whole input list. No optional inputs.
The ten BOOLEAN outputs are the payload. It's easy to read which is which by the label ComfyUI shows on each socket - they're numbered in order, and remember it's least significant first. In the pack's example workflow these feed straight into the boolean switch inputs of a row of Switchable Prompt JM nodes.
The one gotcha that trips people: the first output is the 1's bit, not the "first fragment." If you wire output 1 to your first fragment and then increment the counter, the first fragment toggles every single step while the later ones change slowly. That's not a bug, it's how binary counting works - but it means fragment order in your prompt and bit order in the number won't line up the way intuition expects.
Installing it
It ships in ComfyUI JMNodes (JustinMatters/comfyUI-JMNodes), a small four-node pack. Easiest path is ComfyUI Manager - search "JMNodes" and install. Or clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/JustinMatters/comfyUI-JMNodes
Restart ComfyUI after either one. Good news: there's no requirements.txt, no model downloads, no Python packages to fight with. This is pure integer logic, so it works the moment it's installed. The pack is tiny and was published in one shot in early 2025, so don't expect frequent updates - there's honestly nothing to update.
Common issues
Not much can go wrong with a node this small, but one thing to know: if you feed it a non-integer, the source catches it and silently treats it as 0 rather than crashing - useful defensive behavior, mildly confusing when your combos mysteriously don't appear. And the hard cap means you can't do more than ten fragments per counter. Need more? Chain a second counter or just accept that 1024 combinations is already a lot of images to actually look at.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input_integer | INT | 00–1023 | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |
| BOOLEAN | BOOLEAN | — |