VRGDG_StoryGroupJsonFixer
When your LLM hands you broken JSON, hand it back
- fixed_text
- json_output
- was_fixed
- notes
If you've run an LLM in a ComfyUI graph, you know the scene: the model was supposed to output clean JSON, and instead you got a markdown code fence, a trailing comma, or a stray "Here is your storyboard:" line. VRGDG_StoryGroupJsonFixer exists for exactly this - it takes the messy string, repairs it, and gives you the fixed text, a parsed JSON object, and a flag saying whether anything had to change. It's the "tidy up the LLM's homework" node.
How it works
One required input: text (multiline). Four outputs:
fixed_text- the cleaned string.json_output- the parsed JSON, ready to wire into a JSON-consuming node.was_fixed- a boolean:trueif it had to repair something.notes- a human-readable string describing what was fixed ("stripped markdown fence", "removed trailing comma", etc.).
The mechanism is the usual LLM-JSON rehabilitation kit: strip code fences and surrounding prose, tighten quotes, drop trailing commas, balance brackets, and then re-parse. was_fixed and notes are the parts that make it a good citizen - they tell you whether to trust the output, which matters more than the fix itself. If was_fixed is true and the notes say it had to do major surgery, eyeball fixed_text before it drives a render.
Why this pack needs it
The whole storyboard pipeline runs on LLM-produced structured data: scene lists, prompt overrides, concept lists. One malformed JSON in the middle of that chain and the storyboard stage either dies or silently does something wrong. This node is the safety net between "the model wrote it" and "the pipeline trusts it." In that sense it's the glue that makes the LLM-driven workflow reliable enough to run unattended - which is the pack's whole thing.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
or ComfyUI Manager → "vrgamedev", then restart. Requirements: kornia, librosa, imageio.
The honest take: JSON-repair is a slightly cursed genre - every fixer handles 90% of cases and silently passes through the 10% it shouldn't. This one at least has the decency to tell you when it intervened. Use was_fixed as a tripwire: wire it somewhere visible (a ShowText will do) so a heavily-repaired chunk never reaches your generation pipeline without you seeing the warning. And if your LLM is consistently producing garbage, fix the prompt, not the output - this node is a bandage, not a cure.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| fixed_text | STRING | — |
| json_output | JSON | — |
| was_fixed | BOOLEAN | — |
| notes | STRING | — |