Convert Bool to String
Turn a True/False Toggle Into a String Your Workflow Can Print
- boolean_input
- STRING
This is the kind of node you install, ignore for months, and then suddenly need at 11pm because you want a saved filename to say whether a toggle was on. It takes a boolean (true/false) and hands you back the text "True" or "False".
Why you'd reach for it
ComfyUI is great at passing typed values around - but a lot of things on the far end of a wire only accept text. File name building, text-overlay nodes, debug displays, or a prompt you're assembling out of parts all want strings. When you want a switch's state to show up in one of those places, you need a converter like this one. It's also a natural partner for the pack's other converters (Int, Float, Number to String) if you're stitching together a dynamic label or filename from several values.
How it works
There's not much machinery here, and that's the point. The node calls Python's str() on your boolean input and returns the result. One quirk worth knowing: it type-checks first, and if the input isn't a real boolean it raises an error rather than silently coercing it. In practice that means you should feed it an actual BOOL output (from something like a switch or toggle node), not a string "true" typed in a text box - that last one is a very common way to trip it.
Inputs and outputs
Only what matters:
- boolean_input - the
BOOLyou want converted. This is the only input. - STRING - the output: the text
"True"or"False".
Wire STRING into whatever needs the text: a filename node, a text box elsewhere in the graph, or a display node so you can see the state at a glance.
Installing it
This ships in traugdor's "quadmoon's ComfyUI nodes" pack, a grab-bag of small helpers from one developer. Easiest route is ComfyUI Manager - search for the pack title, or use Install via GIT URL with https://github.com/traugdor/ComfyUI-quadMoons-nodes.git. Manual install is just:
cd ComfyUI/custom_nodes
git clone https://github.com/traugdor/ComfyUI-quadMoons-nodes.git
Then restart ComfyUI. No model files to download, no extra Python dependencies - the converters are pure logic.
Common issues
The only failure mode worth planning for is the type-check above: if you're getting a "not a boolean" error, whatever you're feeding it isn't actually a BOOL. And one tiny gotcha: the output string is capitalized ("True", not "true"), so if you're using it in a filename or a conditional comparison, match the case or you'll wonder why nothing matches.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| boolean_input | BOOL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |