🐟JSON Unpack
Pull named values out of a JSON string without writing code
- value1
- value2
- value3
- value4
- value5
Any time a node in your graph hands you back a JSON blob - an API response, a structured output from an LLM node, a config string - you need something to pull the actual values out before you can wire them anywhere useful. JsonUnpack does exactly that: give it a JSON string and up to five key names, get back up to five values, no scripting required.
How it works
It parses the JSON string you give it, then looks up each key you named and returns the matching value. It's deliberately simple: flat top-level lookups only, key matching is case-insensitive, and a key that doesn't exist in the JSON just comes back empty rather than erroring the whole node out.
The inputs and outputs that matter
json_string(STRING, default"{}", required) - the JSON to parse. Needs to be a real, standard JSON object.key1(STRING, required) - the first key to extract; you always get at least one lookup.key2throughkey5(all optional, STRING) - up to four more keys.
Outputs: value1 through value5, each untyped (*), lining up one-to-one with the keys you provided.
How to install it
Search ComfyUI-QHNodes in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/liuqianhonga/ComfyUI-QHNodes.git
Restart. Main-repo node, nothing to download.
Common issues & troubleshooting
Nested keys come back empty. This is the biggest limitation, and it's stated plainly in the README: this node only reads top-level keys. If your JSON looks like {"result": {"caption": "..."}}, asking for caption directly won't find it - it lives inside result, and this node has no path syntax (like result.caption) to reach into that. If you're working with nested JSON regularly, you'll need something else in your toolkit for that case; this node isn't it.
"Invalid JSON" or empty everything. The json_string input needs to be standard, well-formed JSON - a Python dict repr with single quotes instead of double quotes, or trailing commas, will fail to parse. If the string is coming from another node's text output (say, an LLM response), it's worth checking that output actually is clean JSON and not JSON wrapped in markdown code-fence text or conversational filler, which is a common thing for LLM APIs to add even when asked for JSON only.
A key you know exists still comes back empty. Double-check for typos and stray whitespace in the key name you typed - matching is case-insensitive per the README, but it still has to match the actual key string, not something close to it.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| json_string | STRING | {} | — |
| key1 | STRING | — | |
| key2opt | STRING | — | |
| key3opt | STRING | — | |
| key4opt | STRING | — | |
| key5opt | STRING | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| value1 | * | — |
| value2 | * | — |
| value3 | * | — |
| value4 | * | — |
| value5 | * | — |