ToriiGate Grounding Builder
Tell the captioner who's who before it looks
- prompt
ToriiGate-0.5 wasn't trained to answer "describe this image" like a chat model. It was trained on a set of very specific, structured captioning prompts - multi-part formats where you're supposed to tell it who the characters are, what their known traits are, and which tags apply before it ever sees the image. That's a real strength: give it that grounding and it will name characters and keep their outfits straight in ways generic vision models can't. It's also a pain to hand-write every time.
The Grounding Builder is the node that writes that prompt for you. It's not a generator - it takes your tags, character names, and descriptions and assembles them into the exact prompt string the model expects, which you then feed to either the ToriiGate Captioner or the Llama.cpp Vision Generate node. Pure string building, no model loaded, no GPU touched. You can even preview what it produces before running a heavy caption.
What it does
The node mirrors the structure of the model's own captioning formats (they came from the official ToriiGate Gradio Space). The one output, prompt, is a STRING that wires directly into the prompt input of either generator node.
The input that shapes everything is caption_type - ten formats, from short (fastest) up to long_thoughts_v2 (the most detailed, six-part analysis format) with json, long, min_structured_md, comic-oriented variants, and chroma-style in between. short is the default and honestly a fine place to start; switch to a long_thoughts format only when you need deep per-character captions and are willing to wait.
The rest is your grounding material:
- add_tags + tags - booru tags like
1girl, blue_hair, school_uniform, comma-separated. Only included in the prompt whenadd_tagsis on. Note that the builder deliberately does not convert the underscores; ToriiGate expects them as-is. - add_character_list + character_names - a general list of who's in the image. If the per-character slots below are empty, their tag/description fields fall back to this list by position.
- character_count - 0 to 5, how many character slots get configured.
- add_character_tags + charN_tags - per-character booru tags, matched to the character by name. When you're captioning fan art of a known character, this is the difference between "girl in a school uniform" and the actual outfit.
- add_character_descriptions + charN_description - free-form traits for when tags aren't enough: visual personality, a specific uniform variant, an alternate version.
- use_names - lets the model try to recognize named characters rather than describing everything generically. Leave it on unless the names are actively confusing the output.
Why you'd actually use it
This is the node that makes the pack's "grounded captioning" workflow make sense, and it's the piece people miss when they just hook an image straight into the captioner and wonder why the output is generic. If your goal is consistent captions for a character across a whole batch - say, tagging a dataset for training - the Grounding Builder is the control surface that keeps identity stable. The character-traits section even tells the model to trust your supplied traits over conflicting visual evidence, which is exactly the behavior you want when the art style is loose.
The catch: it only earns its keep if you actually fill in the grounding. caption_type + blank everything else is just a fancier way to say "describe this image." Feed it names and tags and it becomes a proper control panel.
Installing
It ships with the litch230/comfyui_toriigate pack, so install is the same as any of the other nodes: ComfyUI Manager (search "ToriiGate") or git clone https://github.com/litch230/comfyui_toriigate.git into ComfyUI/custom_nodes, then restart. Unlike the Captioner, this node has no special dependencies - it's pure Python string assembly - so you can use it even if you haven't (or can't) install the heavy transformers requirements.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| caption_type | COMBO | short | Caption format. short is fastest; long is detailed natural text; json/min_structured produce structured output; long_thoughts_v2 is the most detailed. |
| use_names | BOOLEAN | true | Allows the model to use or try to recognize character names. |
| add_tags | BOOLEAN | false | Show and use general tags. |
| tags | STRING | General booru tags for the image, separated by commas. Example: 1girl, blue_hair, school_uniform. These are only added to the prompt when add_tags is enabled. | |
| add_character_list | BOOLEAN | false | Show and use character list. |
| character_names | STRING | General character list, separated by commas. If char1_name through char5_name are empty, their tag/description slots are matched to this list by position. | |
| character_count | INT | 10–5 | Number of characters to configure. |
| add_character_tags | BOOLEAN | false | Show and use character tags. |
| add_character_descriptions | BOOLEAN | false | Show and use character descriptions. |
| char1_name | STRING | Name/tag for character 1. Example: hoshimi_miyabi. | |
| char1_tags | STRING | Booru tags specific to character 1, separated by commas. Uses char1_name, or the first name from character_names if char1_name is empty. | |
| char1_description | STRING | Free-form description for character 1. Useful when tags are not enough, such as visual personality, a specific uniform, or an alternate version. | |
| char2_name | STRING | Name/tag for character 2. | |
| char2_tags | STRING | Booru tags specific to character 2, separated by commas. Uses char2_name, or the second name from character_names if char2_name is empty. | |
| char2_description | STRING | Free-form description for character 2. | |
| char3_name | STRING | Name/tag for character 3. | |
| char3_tags | STRING | Booru tags specific to character 3, separated by commas. Uses char3_name, or the third name from character_names if char3_name is empty. | |
| char3_description | STRING | Free-form description for character 3. | |
| char4_name | STRING | Name/tag for character 4. | |
| char4_tags | STRING | Booru tags specific to character 4, separated by commas. Uses char4_name, or the fourth name from character_names if char4_name is empty. | |
| char4_description | STRING | Free-form description for character 4. | |
| char5_name | STRING | Name/tag for character 5. | |
| char5_tags | STRING | Booru tags specific to character 5, separated by commas. Uses char5_name, or the fifth name from character_names if char5_name is empty. | |
| char5_description | STRING | Free-form description for character 5. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |