⭐ Star JSON Preview
See the JSON Your Graph Is Actually Producing
- json
- info
- image
Strings are the invisible data type in ComfyUI. A number, a latent, an image - you can see all of those at a glance. A 4,000-character JSON blob coming out of an LLM node or an API node looks like every other text field: a widget with a scroll bar, or nothing at all if it's a wire. Which is why debugging a structured-prompt pipeline is so miserable. Your Ollama node was supposed to return a scene description with element placements, and all you know is that the next node is unhappy.
⭐ Star JSON Preview is the missing window. You hand it a STRING that should contain JSON, and it does three useful things at once: parses it, renders the structure as a collapsible syntax-highlighted tree right inside the node, and paints a layout mockup of what the JSON describes as a real image output.
This is a plumbing node in the sense that matters - it touches no pixels of your actual generation. It exists to make an existing wire legible, which is the whole job of the data-flow layer in ComfyUI.
What it takes, what it gives back
There are only two inputs, and json is the important one: a STRING you connect. Note it's a forced input, so you wire something into it - a prompt-builder node, an LLM output, a file reader - rather than typing into it. Strictly speaking you can pipe in any string; if it isn't valid JSON the node tells you exactly why.
aspect_ratio is the frame for the preview image: fifteen presets, same list as the pack's ⭐ Starnodes Aspect Ratio Advanced, default 1:1 [1024x1024 square]. The image is rendered at roughly 2 megapixels regardless of which ratio you pick, so a 21:9 preview is a wide, short strip.
Three outputs, and the first one is the reason this node is pleasant instead of annoying:
json- your string, passed through unchanged. That means the node can sit in the middle of a text chain: JSON goes in, tree gets drawn, the exact same JSON continues to the next node. No re-typing, no breaking the pipeline just to inspect it.info- a human-readable summary: valid or not, root type, counts of objects/arrays/strings/numbers/booleans/nulls, nesting depth, and the size in bytes. Or, when parsing fails, the parse error itself.image- the visual preview. Wire it to Preview Image or Save Image.
How the preview image works
If your JSON describes elements placed on a frame - a region string like top left or background center, or numeric x/y/w/h values, or a four-number box array - each element is drawn as a colored box at its position inside the chosen ratio, tinted from the document's own color palette. This is squarely aimed at the scene-JSON format that models like Ideogram and the Qwen prompt builders use, and it means you get a genuine visual read on a described composition before you spend a single GPU-second generating it.
The field names it looks for are forgiving rather than fixed to one schema. Positions can come from region, position, placement, location or area. Boxes can be box, bbox, rect, bounds, coordinates or region. Titles come from name, label, title, id, type or kind, and body text from desc, description, text, content or caption. Palettes get read from color_palette, colors, palette or color.
If none of that is present - plain config JSON, an API payload, a caption file - you don't get an error. You get a nested colored-box diagram of the structure instead, which is still a much better look at the shape of the document than a wall of braces. The renderer works to a budget, so a genuinely enormous document gets abbreviated rather than turned into an unreadable hairball.
Invalid JSON is handled gracefully: the parse error is drawn into the image, reported in info, and your string still passes through the json output. Missing a trailing comma is a two-second diagnosis instead of a twenty-minute hunt.
Installing it
ComfyUI Manager: search Starnodes, Install, restart.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Starnodes2024/ComfyUI_StarNodes
cd ComfyUI_StarNodes
pip install -r requirements.txt
The pack's requirements.txt is all-or-nothing for the other nodes (psd-tools, opencv-python, imageio-ffmpeg, ollama…). This node needs none of it - parsing and drawing use stdlib plus Pillow and torch, which ComfyUI already ships. StarNodes loads module by module, so a missing optional dependency skips one node instead of the whole pack.
After installing, double-click the canvas and search star, or find the ⭐StarNodes category in the node browser.
Practical notes
It's an output node, so it executes on its own - you don't have to wire info or image anywhere just to make it run. That's the opposite of the pack's converter-style utility nodes, and it catches people out in both directions.
Since json is a forced input, feeding a hand-written blob means dropping a text/string node or a wildcard/prompt node in front of it first. The pass-through output makes that painless: text node → JSON Preview → onward, and the last step sees exactly the characters you typed.
And if you get the structure diagram instead of a placement layout, that's not a bug - it means the document doesn't carry placement fields under any name the node recognises. Add a region or x/y/w/h and it snaps into the layout view.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| json | STRING | Connect any STRING that contains JSON. The structure is rendered as a collapsible tree inside the node and as a placement-box layout on the image output. | |
| aspect_ratio | COMBO | 1:1 [1024x1024 square] | Frame ratio for the layout image — the same list as ⭐ Starnodes Aspect Ratio Advanced. Rendered at ~2 megapixels. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| json | STRING | The connected string, passed through unchanged. |
| info | STRING | Human-readable summary: validity, root type, key/item counts, depth and size — or the parse error. |
| image | IMAGE | Visual preview: elements drawn as colored boxes at their region/coordinates — connect to Preview Image or Save Image. |