Get Bool From JSON
Pull a true/false flag out of a JSON blob
- json
- BOOLEAN
Same family as GetTextFromJson, GetFloatFromJson, GetIntFromJson, and GetObjectFromJson - the pack's set of nodes for pulling one specific value out of a JSON object by key. This one specifically reads a boolean: an on/off, enabled/disabled, true/false flag buried somewhere in a JSON payload, so you can wire it straight into anything that takes a BOOLEAN - ISNetSegment's enabled, a BooleanPrimitive comparison, a switch node's condition.
It shows up wherever a workflow is being driven by external data rather than hand-set widgets: an API response with a "use_upscale": true field, an LLM node's structured output, a config object loaded from a URL.
How it works
It walks into the given json value using the key path you provide, then reads whatever's at that path as a boolean. The pack's key syntax handles nesting and arrays: key.[index].subkey.[sub_index] - so settings.[0].enabled reaches into the first element of a settings array and grabs its enabled field. Unlike the plain text/number variants, this node is flagged as an output node in the graph, meaning it can terminate a branch and show its resolved value directly in the UI when the workflow runs - handy for a quick sanity check on a flag without wiring in a separate preview.
The inputs and outputs that matter
Two required inputs:
json- the parsed JSON value to read from, wired in fromLoadJsonFromUrl,LoadJsonFromText, an LLM node, or anotherGet*FromJsonnode drilling into a bigger object.key- the path to the boolean you want, as a string. Top-level is just the field name; nested values use the dotted, bracketed path form above.
One output: BOOLEAN - the resolved flag.
How to install it
Part of the Art Venture pack. ComfyUI Manager: search comfyui-art-venture, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/sipherxyz/comfyui-art-venture
Restart ComfyUI. No downloads - pure Python, instant load.
Common issues & troubleshooting
Always comes out false (or always true). Almost always a key that doesn't match the JSON's real shape - a typo, wrong case, or a path that doesn't actually exist. Check the source data first (turn on print_to_console on whichever loader produced it) and copy the real path rather than guessing.
"It read a string like "true" as false." If the underlying JSON value is the text "true" rather than the JSON boolean true, how that coerces depends on the pack's parsing - don't assume a string and a boolean behave identically. If you control the source, emit an actual JSON boolean rather than a stringified one.
json input is empty or errors. This node expects an already-parsed JSON value, not raw text. If you have a JSON string, run it through LoadJsonFromText first so it's parsed before it reaches this node.
Nested key isn't resolving. Array indices need the bracket form ([0], not 0), and every level of nesting needs its own dot. For deeply nested structures, consider GetObjectFromJson to drill down a level at a time and confirm each step works before chaining the whole path in one go.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| json | JSON | — | |
| key | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |