Complex Prompt Parse JSON
Turn a JSON blob into prompt variables — and let arrays roll the dice for you
- vars
- vars
Complex Prompt Parse JSON is the bulk-loader of the Complex Prompt pack. Where the Set Variable node builds your prompt variables one at a time, this one ingests a whole JSON object in one shot - every key becomes a $variable_name, ready for the main Complex Prompt node to substitute. If you've got prompt data sitting in JSON (an external config, a subject list spat out by an LLM, an export from some tool), this is the node that gets it into your workflow without retyping it into a dozen boxes.
How it works
Feed it json_text - a JSON object - and it walks the keys. Strings and numbers are stored as-is. Here's the fun part: a non-empty array of strings or numbers isn't stored as an array, it's stored as one random pick from the array, chosen with your seed. So this JSON:
{
"subject": ["robot", "astronaut", "architect"],
"style": "cinematic",
"count": 3
}
gives you subject = architect, style = cinematic, count = 3 - and the next queue run (with a fresh seed) hands you a different subject. That's batch variation for free.
What it deliberately ignores: booleans, null, nested objects, empty arrays, and arrays containing any unsupported value. Those keys just don't get set, silently. It's a lenient design that lets you throw a real-world config at it without it exploding over a stray boolean.
It's also lenient about the braces: json_text accepts a full object {"a": 1} or a bare object body without the outer {} - it wraps it for you. And it can extend an existing vars object if you feed one in, with later keys winning.
Inputs and output
Only three inputs:
- json_text - the multiline box with your JSON object.
- seed - controls which array element you get. Like the rest of the pack it randomizes after generation, so each queue run picks a new element unless you pin it.
- vars (optional) - an existing
ArtemKo7vComplexPromptVarsobject to extend rather than start fresh.
Output: vars - the ArtemKo7vComplexPromptVars object, chained onward into the main Complex Prompt node or another variable node in the pack.
Installing it
Same pack, same drill. ComfyUI Manager → search "ComfyUI Complex Prompt Nodes" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ArtemKo7v/ComfyUI-Complex-Prompt
cd ComfyUI-Complex-Prompt
pip install -r requirements.txt
Restart after installing. Dependencies are just dynamicprompts and simpleeval - no models, no downloads beyond pip.
Gotchas
Invalid JSON raises an error, and so does JSON that parses but isn't an object (an array at the top level). The error message shows up on the node, so you'll know immediately. Two subtler traps: numbers become string variables once they hit a prompt (via str() in the substitution pass), so count = 3 renders as 3 in text - fine for prompts, don't expect arithmetic. And remember the array pick is seeded per node; if you want a stable subject across a batch, lock the seed, otherwise every generation rolls again. Both behaviors are by design, not bugs - the seed one just trips people up more than anything else here.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| json_text | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
| varsopt | ArtemKo7vComplexPromptVars | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vars | ArtemKo7vComplexPromptVars | — |