JSON Chain Int Pair (Soze)
Adding numbers without quotes to the JSON chain
- chain_in
- chain_out
JSON distinguishes "42" from 42, and if you're building a payload for an API that validates types, a string where a number belongs is a silent failure waiting to happen. JSON Chain Int Pair (Soze) is the JSON-building node that understands the difference: wire in an INT, give it a name, and it emits the pair as a real integer in the final JSON.
It sits in the same linked-chain family as its siblings (String Pair, Float Pair, Bool Pair, and the rest) - the Soze JSON nodes hand a JSON_PAIRS chain between themselves and JSON Generate serializes the whole thing at the end. This is the node you use for counts, seeds, widths, heights, batch sizes, anything that has to arrive at the other end as a number and not a quoted string.
How it works
The mechanism is the same as every pair node in the family. It reads an optional chain_in (the previous chain as a list of (key, value) tuples), appends its own name: int(value), and returns a new chain through chain_out. The value input uses forceInput - no inline widget, you wire an INT from a number node, a range node, a CSV Reader, wherever. If the name is blank the pair is silently skipped, so a half-wired node won't corrupt the payload.
Inputs and outputs
- name - required string widget, the JSON key.
- value - required INT input. Forced input, so it has to come from a wire, not the widget.
- chain_in - optional
JSON_PAIRS; connect the previous pair node'schain_outhere, or leave empty to start fresh.
One output: chain_out, carrying the whole chain with your pair appended. Chain a few together:
String Pair("name", "Alice") → Int Pair("age", 30) → JSON Generate
→ {"name":"Alice","age":30}. Note the 30 with no quotes - that's the whole point of this node.
Installing it
It's part of the Soze pack, so there's no separate install:
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. No model files, no dependencies beyond the pack's own.
Gotchas
Because it's a forced input, a beginner's first instinct - "why is there no box to type the number?" - is the wrong question. The trade-off is intentional: the value can come from anywhere in the graph, which is what makes the payload dynamic. If you genuinely want to hardcode a number and have nothing to wire from, use an INT constant node or the JSON String Pairs (10X) node, which takes plain text widgets (though those values land as strings, so you'd pay the type penalty - use the dedicated pair nodes when the API cares). And remember the float version exists separately: wire a FLOAT into this node and it will happily truncate it, which is usually not what you wanted.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | — | |
| value | INT | 0-9223372036854776000–9223372036854776000 | — |
| chain_inopt | JSON_PAIRS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| chain_out | JSON_PAIRS | — |