Nodes/VGL Prompts/Parse VGL
ComfyUI Node

Parse VGL

The half-second fix between a good LLM reply and a FIBO prompt that actually works

By Nynxz·Created 6 days ago·Updated 6 days ago· 2
Parse VGL
    • vgl
    • short_description
    • edit_instruction
    ◄text—►

    You got the LLM to write the JSON. It looks fine in the text preview. Then you wire it into Fibo's text encoder and the picture comes back like the structure did nothing - because it did nothing. The reply was wrapped in a markdown json code fence, or had a stray empty field, and the encoder read the whole thing as prose.

    Parse VGL is the node that catches that. One input, no settings, and it's the reason a two-node pack exists.

    Why anything needs parsing

    Bria's FIBO doesn't take a sentence. It takes a VGL: a JSON description of the scene - objects, lighting, camera, style - because the model was trained on long structured captions rather than prose. Handing a diffusion model fields instead of a run-on sentence gives you clean separation between "what's in frame" and "how it's lit", the same reason JSON prompts work on LLM-encoded bases generally: not because the model parses JSON, but because fields stop attributes bleeding into each other.

    The catch is on the other end. As the pack's README puts it, FIBO's text encoder treats anything that isn't valid JSON as plain text - no error, no warning, structure gone. And an LLM doesn't hand you clean JSON by default. It hands you chat: a preamble, a markdown fence, an empty "mood": "", a field the schema never had. Any one of those is enough to make the encoder shrug.

    So: loud, or silent. Parse VGL picks loud.

    What it actually does to the reply

    Four steps, all of them copied from the behaviour of bria_vgl's own Payload.parse:

    1. Strips a markdown code fence - but only one that wraps the whole reply. If the model wrote "Here's your JSON!" before the fence, the parse fails rather than guessing where the object starts.
    2. Parses it. If that fails it raises not valid VGL JSON: … and the run stops. That's the point - a stopped run is cheaper than forty generations of silently unstructured prompt.
    3. Drops unknown fields. Anything the Thales VGL doesn't name gets thrown out.
    4. Drops empty values and reorders the keys to match the model's schema, so the encoder sees what the model was trained on.

    It prunes against the full VGL schema - generate's fields plus edit_instruction - so a caption and an edit come out through the same door.

    The input, and the three outputs

    One input: text, multiline, nothing to tune. Note it's a forced input - you can't paste into the widget, it wants a wire. From an LLM node that's its generated text; if you're pasting a saved VGL by hand, drop a multiline primitive in and type there.

    Then:

    • vgl - the compact JSON. This is the one that matters. Into TextEncodeFibo2's prompt, or chain it into another VGL Prompt node's input_vgl / input_image_vgl for a second pass.
    • short_description - whatever the model put in that field, handy for a text preview to check it described the scene you asked for.
    • edit_instruction - the edit payload's instruction field, empty unless the reply came from an edit. Don't be alarmed by a blank on a generate VGL.

    Caption an image, feed that VGL into an edit as the baseline, and the LLM edits from an accurate description instead of re-deriving your image from scratch. Same node, twice.

    Installing it

    It ships in ComfyUI-VGLPrompts, so installing the pack gets you both nodes. In ComfyUI Manager search VGL Prompts, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Nynxz/ComfyUI-VGLPrompts
    

    Then restart ComfyUI.

    Nothing else to fetch: no models, no requirements.txt, no pip install, because numpy, torch and Pillow already ship with ComfyUI. The one real requirement is a current ComfyUI - the nodes use the newer comfy_api V3 schema, so a stale install won't show them at all.

    When it goes wrong

    not valid VGL JSON. The node is telling you the LLM didn't answer with JSON. Usual suspects: the reply got truncated by a low max_length on the LLM node (a VGL is long - 4096, not 512); the model is a reasoning model that leaked its scratch-work into the output; or it refused. Fix it upstream. Parse VGL can strip a fence, it can't invent a closing brace.

    Everything parsed but the fields are gone. Check you're feeding it a Thales VGL. The pruner is strict by design, so another pack's JSON vocabulary gets politely emptied out.

    The encoder still acts like it's ignoring you. Then the JSON was valid and the content was thin - a VGL with two fields filled generates loosely. Prompt problem, not parse problem.

    Last thing, because people keep getting it wrong: this pack contains no LLM. Whatever writes the VGL is the node you chose. Parse VGL is the bouncer at the end of the pipeline.

    CategoryVGL Prompts

    Inputs (1)

    NameTypeDefaultDescription
    textSTRINGThe LLM node's reply.

    Outputs (3)

    NameTypeDescription
    vglSTRINGCompact VGL JSON, as bria_vgl puts it into a prompt.
    short_descriptionSTRING—
    edit_instructionSTRINGEmpty unless the reply came from an edit.