Gemini JSON Parser
The free JSON utility that saves your workflow from itself
- result
- info
- success
Gemini in the name, zero Gemini involved
Like its sibling GeminiFieldExtractor, this node is a pure local utility. It doesn't call any API, needs no key, and runs instantly - its job is to validate, pretty-print, and dissect JSON that other nodes (usually the API ones in this same pack) produce. If you've ever wired a raw API response into a workflow and gotten a baffling "invalid JSON" error downstream, this is the node that tells you what you actually received.
It's the debugging sidekick of the pack: a cheap check before you trust something, and a way to understand a blob of JSON without leaving ComfyUI.
How it works
Feed it a json_input (raw JSON or markdown-fenced) and pick an operation:
- validate - checks the JSON and reports its structure. The default, and the one you'll reach for first.
- format - pretty-prints with
indentspaces (0β8, default 2) and optionalsort_keysfor alphabetical order. - minify - strips whitespace for compact storage, and reports the byte savings.
- extract_keys - lists every key path in the JSON (so
{"user": {"settings": {"theme": "dark"}}}yieldsuser,user.settings,user.settings.theme). Invaluable when a Gemini response hands you a nested structure you didn't expect. - get_type - maps the JSON's type structure, showing where objects, arrays, strings and numbers actually live.
- count_items - tallies objects, arrays, strings, numbers, booleans, nulls and total keys.
Inputs and outputs
Two inputs beyond the JSON itself: indent and sort_keys, both only relevant for the format operation. Outputs are result (the operation's output), info (a detailed description - the structure summary for validate, byte savings for minify, etc.), and success (BOOLEAN). That success output is genuinely useful: wire it into a switch or conditional and you can branch a workflow on whether the upstream JSON is actually valid.
Install
Standard pack install, one line at a time:
cd ComfyUI/custom_nodes
git clone https://github.com/jqy-yo/comfyui-gemini-nodes
cd comfyui-gemini-nodes
pip install -r requirements.txt
Restart ComfyUI, then find it under the Gemini menu. No API key required for this one, ever.
Where people get burned
The one real failure mode is feeding it something that isn't JSON - at which point success goes false and result carries the parse error, which is the intended behavior, not a bug. The more common workflow-level mistake is skipping the validation step entirely and pasting raw API output into a node that needs clean JSON. The README's own guidance is to chain these: validate β extract keys β extract the field you need. Run validate on anything unfamiliar before you build on top of it, and let extract_keys show you the terrain. Five minutes of this saves an hour of guessing.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| json_input | STRING | β | |
| operation | COMBO | validate | 6 options: validate, format, minify, extract_keys, get_type, count_items |
| indentopt | INT | 20β8 | β |
| sort_keysopt | BOOLEAN | false | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| result | STRING | β |
| info | STRING | β |
| success | BOOLEAN | β |