Modify JSON Object [LP]
Set one key on a JSON object, then chain the next
- json_object
- json_object
- json_string
If you've started wiring up anything that talks to an API from inside ComfyUI - the same pack's own Qwen Image Edit node, a webhook, a logging call - you eventually hit the problem of building a JSON payload without leaving the graph. You could type the whole thing into one giant multiline string and hope you didn't miss a comma. Or you could build it one field at a time with nodes like this one, where each node sets exactly one key and hands the object to the next.
What it does
Modify JSON Object takes a key and a value, and an optional json_object to build on top of. Leave json_object unwired and it starts a brand-new object containing just your one pair. Wire in an existing object and it writes (or overwrites) that key on top of whatever's already there, leaving everything else untouched. Chain three or four of these in a row - each one adding another field - and you've assembled a full object without ever hand-typing a JSON literal. It's a fluent builder, not a full JSON editor: one write per node, by design.
Inputs and outputs that matter
Only three fields, and they're the whole node:
key(string, defaults tonew_key) - the field name you're setting.value(string, defaults tonew_value) - what you're setting it to.json_object(optional, JSON) - the object to build on. Skip it to start fresh.
It gives you back two things: json_object, the updated JSON structure for feeding into the next Modify node, ParseJSONString-LP, or anything else that declares a JSON-typed input; and json_string, the same thing rendered as plain text, for a Show Text node, a filename, or anywhere that just wants a string.
The one real limitation worth knowing up front: value is a plain string field. There's no separate widget for a number, a boolean, or a nested object - everything you type lands in the JSON as text. If the API on the other end is strict about types (an integer field that rejects "5" but accepts 5), you'll need a parser downstream that coerces it, because this node won't.
Installing it
Same as every node in this pack: through ComfyUI Manager, search "ComfyUI Level Pixel" or "ComfyUI-LevelPixel" and install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/LevelPixel/ComfyUI-LevelPixel.git
Restart ComfyUI afterward. There's nothing to download - no checkpoints, no extra Python packages beyond what ComfyUI already ships with. The JSON nodes are one of the newer additions to the pack (added alongside the Qwen Image Edit API nodes), and the core JSON logic is credited in the README to Comfyui-Simple-Json-Node rather than written from scratch, for what that's worth if you're deciding whether to trust it with something load-bearing.
Where people get burned
The JSON type here is its own custom pin, the same way the pack's Pipe nodes use a custom PIPE_LINE type - it only connects to other nodes that explicitly declare a JSON input, not to a generic string socket. If you're trying to plug json_object straight into something expecting plain text, that's why the wire won't drop; use json_string instead.
The other trap is order-of-operations when chaining several of these. Each node only mutates and forwards what's wired into its own json_object input - if you accidentally leave one unwired partway through a chain, that node silently starts a brand-new object instead of building on the previous one, and every key you set before it quietly disappears from the final output. Worth a quick Show Text check on the json_string output after you wire up a chain, just to confirm the object actually looks like you think it does before it goes anywhere that matters.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | new_key | — |
| value | STRING | new_value | — |
| json_objectopt | JSON | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| json_object | JSON | — |
| json_string | STRING | — |