Nodes/ComfyUI-ToriiGate-Reforged/ToriiGate Caption Reforged
ComfyUI Node

ToriiGate Caption Reforged

A \"CLIP\" node that actually writes you a caption — ToriiGate Caption Reforged

By CocyNoric·Created 10 days ago·Updated 9 days ago· 2
ToriiGate Caption Reforged
  • clip
  • image
  • caption
max_pixels_mp1.0
max_new_tokens512
temperature0.50
top_p1.00
top_k0
decodinggreedy_fast
seed42
prompt

First, get the name straight: despite saying "CLIP", this node does not touch your diffusion text encoder. It runs a whole vision-language model. Feed it an image, it reads it and hands you a caption as a plain string. That's the entire job, and it does it locally - no API, no key, no upload. It's part of the ComfyUI-ToriiGate-Reforged pack, a cleaned-up fork of the old litch230/comfyui_toriigate extension that dropped the bundled model loader and llama.cpp backend in favor of ComfyUI's native CLIP loading.

ToriiGate itself is a fine-tuned Qwen3.5-4B model built for describing anime-ish art, and the Reforged pack is how it slots into a modern workflow without you babysitting a separate backend. People reach for it for the same two jobs every VLM captioner does: building caption files for LoRA training, or seeding an img2img prompt from a reference image. The difference from JoyCaption or Florence-2 is that ToriiGate is built around detailed, structured natural-language output tuned for this model's own prompt formats - and, being a local uncensored model, it won't refuse to describe half your dataset.

How it works

The node assumes you've already loaded the model with ComfyUI's native Load CLIP node. It resizes your image to a sane pixel budget, normalizes it to match ToriiGate's original vision preprocessing, builds the model's chat messages with a ToriiGate system prompt (thinking disabled - it doesn't want the model's reasoning block in your caption), then generates. If you're the "how does it actually work" type, the pack is one small Python file and genuinely pleasant to read.

The inputs that matter:

  • clip - the ToriiGate/Qwen3.5 CLIP object from Load CLIP. The node doesn't inspect it, so if you feed it the wrong thing it'll only complain when it hits the tokenizer.
  • image - your IMAGE tensor. Only the first image in a batch gets captioned, so don't batch-hopefully here.
  • max_pixels_mp - the resize budget in megapixels before the visual encoder. Default 1.0. One trap: ToriiGate's original ~0.262 MP minimum is preserved, so a 256x256 input gets enlarged to 512x512 no matter what you set.
  • decoding - greedy_fast (deterministic, the default) or sample. Sample is when temperature, top_p, and top_k actually do anything; leave them alone until you know why you're changing them.
  • max_new_tokens - 512 by default; bump it for long-form modes.
  • prompt (optional) - a ToriiGate-format grounding instruction. Leave it blank and you get a short default ("Describe this image in detail."); wire in the Grounding Builder for the good stuff.

Output: a single caption STRING, ready for any text preview node, a training-caption writer, or a text-input pin.

Install

Install the pack first:

cd ComfyUI/custom_nodes
git clone https://github.com/CocyNoric/ComfyUI-ToriiGate-Reforged.git

Restart ComfyUI (or install via ComfyUI Manager by searching "ToriiGate"). No Python dependencies - there's no requirements.txt, which is the whole point of the Reforged approach. Then the model. Grab ToriiGate-0.5_int8_convrot.safetensors from Ronysoc/ToriiGate-0.5-Int8-ConvRot (ModelScope mirror if you're in China) and drop it in ComfyUI/models/clip/. In Load CLIP pick it, set type: stable_diffusion, device: default.

Common issues

The big one people hit: you connect a normal CLIP model instead of the ToriiGate weight and get a runtime error about the tokenizer ignoring the IMAGE input. That's the pack correctly telling you you loaded the wrong thing - the ToriiGate weight carries the visual encoder, most diffusion CLIP models don't.

The other thing to keep honest: character identification is this model's soft spot. The README warns outright that accuracy on who is who isn't always great, quantized or not. Every VLM in this space fumbles multi-subject attribution (JoyCaption's authors say the same), so treat the caption as a strong draft and audit small training sets by hand.

CategoryToriiGate

Inputs (10)

NameTypeDefaultDescription
clipCLIPToriiGate-compatible CLIP/model from a native ComfyUI loader. The node does not inspect its format or identity.
imageIMAGEImage to caption; only the first image in the batch is used.
max_pixels_mpFLOAT1.00.1–8Maximum resize budget before the built-in visual encoder. ToriiGate's original ~0.262 MP minimum is preserved, so 256x256 is enlarged to 512x512.
max_new_tokensINT5121–8192Maximum number of generated tokens.
temperatureFLOAT0.500–2Sampling temperature; used when decoding is sample.
top_pFLOAT1.000–1Nucleus sampling threshold.
top_kINT00–200Top-k sampling; 0 disables the limit.
decodingCOMBOgreedy_fastgreedy_fast is deterministic; sample uses temperature/top-p/top-k.
seedINT420–18446744073709550000Fixed seed for repeatable sampling. Randomization is controlled by ComfyUI's generation control.
promptoptSTRINGToriiGate prompt; connect ToriiGate Grounding Builder Reforged or leave blank for a short default.

Outputs (1)

NameTypeDescription
captionSTRING