JSON Chain Array Pair (Soze)
One node, ten sockets — building JSON arrays from anything
- value_1
- value_2
- value_3
- value_4
- value_5
- value_6
- value_7
- value_8
- value_9
- value_10
- chain_in
- chain_out
Arrays are where hand-building JSON really starts to hurt. You've got a list of tags, a few URLs, several prompt fragments - and trying to type that correctly as ["a","b","c"] inside a ComfyUI text box is asking for a stray comma to kill your whole payload. JSON Chain Array Pair (Soze) turns it into sockets: up to ten inputs, any type, and only the ones you actually connect end up in the array, in slot order.
It's the most flexible node in the Soze JSON chain family precisely because it doesn't care what you feed it. Connect a mix of strings, ints, floats and booleans - or even chain outputs from other parts of the graph - and it coerces each one to a proper JSON value before bundling them under the name key. If an API wants "tags": ["epic", "sunset"] or "steps": [20, 30, 40], this is the node.
How it works
The value slots (value_1 through value_10) use the community "*" wildcard trick: each input declares itself as "accepts anything," so ComfyUI lets you connect any type to any slot. On execution, the node walks the slots in order, keeps only the ones that are connected, coerces each to a JSON-friendly value, and appends (name, [ ... ]) to the incoming JSON_PAIRS chain. Unconnected slots are simply skipped - no empty holes in the middle of your array.
Inputs and outputs
- name - required string widget, the key the array lands under.
- value_1 … value_10 - optional, accept any type. Connect in the order you want the array elements. All forced inputs.
- chain_in - optional
JSON_PAIRS; the previous pair node'schain_out.
Output: chain_out. A typical chain:
Array Pair("tags", "epic", "sunset") → JSON Generate
→ {"tags":["epic","sunset"]}.
Installing it
Part of the Soze pack:
cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt
Restart ComfyUI, or search ComfyUI_Soze in ComfyUI Manager.
Gotchas
Two things to keep in mind. Order matters and it's determined by slot number, not by which socket you happen to connect first - so value_1 is always element 0. And because the slots accept anything, ComfyUI won't stop you from feeding this node an IMAGE tensor and then wondering why the API blew up: the coercion handles primitives fine but a raw tensor is not a JSON value. For images and audio the pack has dedicated array-pair nodes (JSON Image Array Pair, JSON Audio Array Pair) that encode them properly - use those instead of trying to force media through this one.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | — | |
| value_1opt | * | — | |
| value_2opt | * | — | |
| value_3opt | * | — | |
| value_4opt | * | — | |
| value_5opt | * | — | |
| value_6opt | * | — | |
| value_7opt | * | — | |
| value_8opt | * | — | |
| value_9opt | * | — | |
| value_10opt | * | — | |
| chain_inopt | JSON_PAIRS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| chain_out | JSON_PAIRS | — |