Nodes/Quality of Life Nodes for ComfyUI/JSON Chain Bool Pair (Soze)
ComfyUI Node

JSON Chain Bool Pair (Soze)

True and false — not 'true' and 'false'

By SozeInc·Created 2 years ago·Updated 8 days ago· 10
JSON Chain Bool Pair (Soze)
  • chain_in
  • chain_out
name
valuefalse

API payloads are full of on/off flags - "upscale": true, "interpolate": false - and JSON has its own spelling for them: lowercase true and false, no quotes. String a value like that through a generic text node and you get "true" with quotes, which is a string, and some endpoints will reject it outright. JSON Chain Bool Pair (Soze) is the pair node that keeps booleans booleans. Wire a BOOLEAN in, name it, done.

It's the same linked-chain design as the whole Soze JSON family: JSON_PAIRS tuples passed from pair node to pair node, terminating in JSON Generate. Reach for it any time a parameter is a checkbox on your side - that's a boolean upstream, and this is the only pair node in the family that preserves it as one in the output.

How it works

Same mechanics as every pair node: take the optional chain_in, append (name, bool(value)), hand out a new chain. The value input is forced - no widget, wire a BOOLEAN in from a switch/checkbox node, a boolean converter, or a conditional somewhere in your graph. Blank name → pair skipped. Nothing clever, which is the right amount of clever for a boolean.

Inputs and outputs

  • name - required string widget, the JSON key.
  • value - required BOOLEAN input, forced.
  • chain_in - optional JSON_PAIRS; the previous pair's chain_out, or empty to start a new chain.

Output: chain_out. Example:

Bool Pair("save", true) → JSON Generate

{"save":true}.

Installing it

Part of the Soze pack:

cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt

Restart ComfyUI, or search ComfyUI_Soze in ComfyUI Manager. No models, no keys.

Gotchas

This one is thin on footguns, which is a relief. The one thing worth knowing: if you're tempted to just use a String Pair and type "true", don't - the JSON API you're talking to will get "true" and may not coerce it. Also note that Python's bool check happens on the way in, so wiring an INT or STRING into the BOOLEAN socket may be rejected at connection time by ComfyUI's type system; if you have a string like "yes"/"no" you need a converter first. Keep the bool in a Bool Pair and you'll never have a quote problem.

CategorySoze Nodes/JSON

Inputs (3)

NameTypeDefaultDescription
nameSTRING
valueBOOLEANfalse
chain_inoptJSON_PAIRS

Outputs (1)

NameTypeDescription
chain_outJSON_PAIRS