VRGDG_LyricSegmentJsonFixer
When Your LLM Emits Broken JSON, This Is the Firefighter
- fixed_text
- json_output
- was_fixed
- notes
VRGDG_LyricSegmentJsonFixer takes text that was supposed to be JSON, repairs it, and hands you both the fixed text and the parsed structure. If you've ever asked an LLM for a clean JSON array and gotten trailing commas, an unclosed brace, or a stray code fence instead, this node is aimed directly at you.
The context it was built for: the VRGameDevGirl music-video workflow has an LLM produce lyricSegmentN blocks - per-line lyric data with timing and scene info - and LLMs break JSON in predictable, maddening ways. Rather than re-prompting and hoping, the workflow runs the output through this fixer. You paste the suspect text into text and get back:
fixed_text- the repaired JSON as a string.json_output- the same thing parsed into an actual JSON object you can feed to nodes that expect structured data.was_fixed- a boolean telling you whether anything had to change.notes- what, if anything, the node had to repair.
That last pair is quietly useful. was_fixed lets you build branching logic ("if it came through clean, skip the fallback path"), and notes saves you from wondering whether your upstream LLM is drifting - a sudden run of was_fixed = true with notes about unclosed brackets is your cue that the prompt needs tightening.
What it fixes
The usual LLM JSON crimes: trailing commas, missing closing brackets, unquoted keys, stray markdown fences around the block, and truncated output. It's a repair tool, not a validator - if the input is structurally too far gone (say, the model hallucinated a whole alternate schema), it will do what it can and tell you about it in notes rather than silently returning garbage.
Where it fits
This is one of the most portable nodes in the pack. Yes, it exists for lyric segments, but "clean up an LLM's JSON before a JSON-parsing node eats it" is a task in basically every modern ComfyUI workflow that touches an API. It's also the pragmatic answer to the classic advice "just use structured output / response_schema": when you can't control the upstream format, a tolerant fixer is cheaper than fighting the prompt.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
Restart ComfyUI; find it under VRGDG/General. ComfyUI Manager users search vrgamedev. No extra downloads for this node.
Honest note
Don't treat it as a guarantee. JSON repair is inherently heuristic - there are malformed inputs no fixer can recover, and the notes output exists precisely because sometimes it can't. For the common failure modes of a decent LLM, it's reliable enough to just wire in and forget. For the truly unhinged output, nothing beats fixing the prompt upstream.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| fixed_text | STRING | — |
| json_output | JSON | — |
| was_fixed | BOOLEAN | — |
| notes | STRING | — |