Nodes/Comfyui-PixNodes/Join JSON Object (PixNodes)
ComfyUI Node

Join JSON Object (PixNodes)

Merge a pile of inputs into one JSON object

By pixixai·Created 8 months ago·Updated 6 months ago· 24
Join JSON Object (PixNodes)
  • AnyData_1
  • json_object

Building a JSON object is the second-most common JSON chore in ComfyUI, right after building a list. Join JSON Object is that chore in node form: wire several inputs in, get one merged dictionary out. It's the sibling of Join JSON List in the same pack, and it shares the same philosophy - inputs can be structured data or JSON text, and the node figures out which is which.

The mechanism is straightforward but the merge rule matters, so pay attention. Each input that arrives as a dict (or a JSON object string) gets flattened into the result - its keys merge into the top-level object, ignoring whatever the port is called. Each input that is not a dict - a string, a number, a list - gets stored as a value, keyed by its port name. Later inputs overwrite earlier ones on key collisions, so ordering matters if two dicts share a field.

What you actually set

  • AnyData_1 (wildcard, required) - the first input; the frontend lets you add more AnyData_N ports as needed.

That's it. There's no merge-key list, no skip toggle - those live in the pack's JSON Object Combine, which is the more configurable cousin if you want named ports and empty-input handling. This node is the quick-and-dirty version: connect, done.

Output is json_object (JSON), a Python dict on a JSON port. Same pack-wide reminder as its sibling: since v1.0.8 this pack's JSON ports carry live Python objects, not JSON strings. If you need formatted text, run it through the pack's JSON Unpacker; don't expect this port to drop a {...} string into a text field.

When you'd use it

The classic pattern is assembling a parameter object for an API node or a file-saver from values that live in different corners of the graph - a seed over here, a width and height over there, an upscaled prompt from somewhere else. It's also the natural aggregator for "collect the outputs of several nodes into one thing I can inspect or serialize."

Install

Part of Comfyui-PixNodes. ComfyUI Manager → search "PixNodes" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/pixixai/Comfyui-PixNodes

then restart. (Ignore the README's manual-install line that pastes the wrong repo URL, ComfyUI-AlignLayout - use the one above.)

Where it trips people up

The port-name-as-key behavior is the trap. Connect a plain string to AnyData_3 and the result has a key literally called AnyData_3 - useful if you know it, baffling if you don't. If you want human-readable keys, you have two better options: feed in proper dicts (whose keys get respected), or use JSON Object Combine, where you type the port names yourself. Also remember None inputs are skipped entirely, so a disconnected port silently vanishes rather than adding an empty field.

CategoryPixNodes/JSON

Inputs (1)

NameTypeDefaultDescription
AnyData_1*

Outputs (1)

NameTypeDescription
json_objectJSON