Convert String to JSON [LP]
Parsing text into a real JSON object
- json_object
This one does exactly what the name says: take a piece of text that looks like JSON, and hand back a real JSON object ComfyUI's graph can pass around as a typed value instead of a blob of characters. It's a small node, but it's the entry point for a genuinely useful family - once your data is a JSON object inside the graph, you can pull individual fields out of it, branch on them, or reassemble them, instead of doing string surgery on raw text every time.
Why you'd want this
JSON nodes are a recent addition to the pack - the changelog puts them at v1.3.4 (24-02-2026), alongside the Qwen Image Edit API nodes, and the README credits Comfyui-Simple-Json-Node by Q-Bug4 for "some JSON nodes," so this is very likely a ported/adapted implementation rather than something built from scratch here. The use case is the same regardless of authorship: JSON is the natural shape for anything structured - API responses, config blocks, a bundle of settings you want to pass through the graph as one wire instead of five. If something upstream (a text field, an API call, a file read) gives you that data as a plain string, this node is the bridge into a workable object.
How it works
Under the hood this is almost certainly a straight json.loads() call - parse the string, return the object. That means it's strict: valid JSON parses cleanly, and anything that isn't gets rejected rather than partially interpreted. There's no schema validation or field extraction happening here - this node only converts the shape, it doesn't know or care what's inside.
The inputs and outputs that matter
- json_string - the text to parse, a STRING field defaulting to
"{}"(an empty object), so an unconnected node doesn't error out of the box. - Output - json_object, ComfyUI's native JSON type, ready to feed into whatever downstream node reads fields out of it or ships it somewhere else structured.
That's the whole node: one input, one output, no configuration.
How to install it
ComfyUI Manager: search "ComfyUI Level Pixel" or the repo name ComfyUI-LevelPixel, install, restart - updates automatically through Manager's "Update ALL." Manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/LevelPixel/ComfyUI-LevelPixel.git
Restart ComfyUI. Pure text parsing, no models or extra dependencies to fetch.
Common issues & troubleshooting
The node errors on text that "looks like" JSON to you. The most common culprits: single quotes instead of double quotes ({'key': 'value'} is Python dict syntax, not JSON), a trailing comma after the last item, or unquoted keys. Strict JSON wants double-quoted strings and no trailing commas - if your source text is actually a Python dict's repr() rather than real JSON, run it through a proper serializer upstream instead of relying on this node to be forgiving.
You're not sure the string will always be valid JSON. There's no fallback value and no try/except behavior visible in the schema - a bad parse throws and stops the run at that point, the same strict-by-default posture most of this pack's conversion nodes take. If your source is unreliable (user input, a flaky API), validate or sanitize the string before it reaches this node.
You want to go the other way. Pair this with the pack's own ConvertJsonToString-LP for the reverse conversion - object back to text - when you need to serialize a JSON value for logging, saving, or passing to something that only accepts plain strings.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| json_string | STRING | {} | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| json_object | JSON | — |