AIIA JSON Builder 🏗️
Stop Typing JSON Into ComfyUI Text Widgets
- json_string
The AIIA podcast and diarization nodes all exchange data as JSON strings - which is great for flexibility and maddening when you have to hand-write one. AIIA JSON Builder 🏗️ is the pack's answer: it assembles a JSON object from up to four key/value pairs, so you can build structured data from upstream strings instead of pasting braces. It's a tiny utility node with one job, and it does it without drama.
How it works
You get four slots - key_1/value_1 are required, key_2 through key_4 with their values are optional. It drops them into a dict and serializes it as a JSON string. The genuinely useful trick: any value that is itself valid JSON gets parsed into a real type rather than stored as a string. So you can feed a nested object or an array in value_2 and it stays an object/array instead of becoming "\"[...]\"" - that's what keeps downstream JSON Extractor lookups working.
Example: with key_1=speaker, value_1=A, key_2=lines, value_2=[{"text":"hi"},{"text":"bye"}], you get:
{
"speaker": "A",
"lines": [
{"text": "hi"},
{"text": "bye"}
]
}
Numbers and booleans work the same way - value_1=42 comes out as a number, not the string "42".
The inputs that matter
Honestly, just the pairs. A couple of practical notes:
- The
value_*inputs areforceInput- they want to be wired from other nodes, which is the whole point (build JSON from pipeline values, not hand-typed text). You can type into them, but the design intent is wiring. - Keys are plain strings; empty keys are skipped, so leaving
key_3/key_4blank is fine and won't inject garbage keys. - There's no nesting of builders here - if you need a nested structure, build the inner object with a second builder or a string and feed it into a
value_*slot, where it'll be parsed as JSON.
Output is json_string, which plugs straight into AIIA JSON Extractor, the podcast parser nodes, or any node that consumes JSON strings.
When you'd use it
It shines in the AIIA podcast flow and in any workflow where you're programmatically constructing payloads - e.g. wrapping per-speaker data before sending it to a downstream processor, or building small config objects. If you already run a heavier utility suite you might have a comparable node, but this one costs nothing extra and matches the pack's JSON conventions out of the box.
Install
Standard pack install: havvk/ComfyUI_AIIA via ComfyUI Manager or git clone https://github.com/havvk/ComfyUI_AIIA.git into custom_nodes/, restart. No models, no dependencies - instant.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| key_1 | STRING | key1 | — |
| value_1 | STRING | — | |
| key_2opt | STRING | — | |
| value_2opt | STRING | — | |
| key_3opt | STRING | — | |
| value_3opt | STRING | — | |
| key_4opt | STRING | — | |
| value_4opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| json_string | STRING | — |