KIE Parse Prompt Grid JSON (1..9) [SL]
Turn an LLM's prompt JSON into nine wires
- prompt 1
- prompt 2
- prompt 3
- prompt 4
- prompt 5
- prompt 6
- prompt 7
- prompt 8
- prompt 9
- count
- prompts_list
- prompts_list_seq
The dumbest-looking node in this pack and one of the most useful. You ask an LLM for "nine prompts for a 3x3 grid," it hands you a JSON blob, and this node un-jams that blob into nine separate string outputs plus a count. No API, no key, no credits - it's a pure local JSON parser with very forgiving taste in JSON.
Why it exists: the natural way to batch a grid generation is to let an LLM write all nine prompts at once, then feed them to a Nano Banana Pro or Seedream call per cell. The glue between "LLM says yes" and "nine cells filled" is exactly this node. It's the sibling of GridSlice in the pack's story - one call, many cells - just working on text instead of pixels.
The inputs that matter
- json_text - the raw LLM output. It's force-input, so it wants a wire from a text node, not a typed value.
- default_prompt - fallback if parsing yields nothing. Set this and a broken LLM response degrades to "fill every cell with this prompt" instead of killing the run.
- max_items - cap at 1–9, default 9.
- strict - default off. Flip it on and any parse failure raises instead of falling back.
- debug - prints what it saw to the console. Turn this on the first time and thank it later.
Outputs: prompt 1 through prompt 9 (empty strings for missing cells), plus count (INT), prompts_list (a STRING list for automation), and prompts_list_seq (a proper list output).
What JSON it actually accepts
Generously, is the answer. It handles a plain array of prompt strings, or an object with a prompts array, or keyed objects like prompt1/prompt_1/p1/numeric keys (sorted by index). It strips code fences around the JSON, and if the LLM buried the JSON in prose, it extracts the first {...} or [...] blob it finds. The one thing it can't do is read the LLM's mind when the model returns plain prose with no JSON inside - then you get the "No prompts found in json_text" error, or the default_prompt fallback if you set one.
Install
Same as the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/v3devv/ComfyUI-Kie-API-Serverless
or Manager search "Kie-API-Serverless", restart. No dependencies beyond what ComfyUI ships.
The one trap
Don't forget the prompts_list output for long runs. Once you exceed the 9 named wires, that list output (plus count) is what you'd loop over for bigger grids. And in the "grid + LLM + API" loop, remember the model's JSON quality is the actual bottleneck - a strict-schema request to your LLM (this pack's Gemini node supports response_format_json for exactly this) saves you a world of parser-fallback pain.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| json_text | STRING | — | |
| default_promptopt | STRING | — | |
| max_itemsopt | INT | 91–9 | — |
| strictopt | BOOLEAN | false | — |
| debugopt | BOOLEAN | false | — |
Outputs (12)
| Name | Type | Description |
|---|---|---|
| prompt 1 | STRING | — |
| prompt 2 | STRING | — |
| prompt 3 | STRING | — |
| prompt 4 | STRING | — |
| prompt 5 | STRING | — |
| prompt 6 | STRING | — |
| prompt 7 | STRING | — |
| prompt 8 | STRING | — |
| prompt 9 | STRING | — |
| count | INT | — |
| prompts_list | STRING | — |
| prompts_list_seq | STRING | — |