ToriiGate Llama.cpp Vision Generate
The fast path to anime captions
- image
- caption
This is the node the pack's author actually wants you to use. The README marks the llama.cpp path "Recommended" over the local Transformers Captioner, and for good reason: the model runs as a GGUF through a separate llama-server, which means much faster inference, lower VRAM usage, and - the big one for anyone who's fought custom-node dependency hell - none of the transformers/torch loading code running inside ComfyUI. The trade is that you have to run the server yourself, manually, before you start.
ToriiGate-0.5 itself is an anime and digital-art captioning model, and this node is the "send it over the wire" version. It takes an image from your graph, converts it to a base64 PNG, embeds it in an OpenAI-compatible chat-completions request, and POSTs it to your llama-server, which runs the GGUF weights plus the vision projector (--mmproj). Out the other side comes your caption.
The inputs that matter
- server_url - defaults to
http://127.0.0.1:8080. This must point at a live llama-server; there's no auto-start. - model_name - the GGUF quantization dropdown, defaulting to
DraconicDragon/ToriiGate-0.5-GGUF:Q4_K_M(3.07 GB). The identifier must match what the llama-server router registered at startup. Q4_K_M is the sane default; the tooltip calls it the "recommended balance of quality vs size," and it is. If you have VRAM to spare, Q8 is closer to the full model, but for captioning text output the difference is rarely worth it.custom_model_nameoverrides the dropdown for renamed local files or non-GGUF backends. - image - required; only the first image in the batch is sent.
- prompt - optional; wire the ToriiGate Grounding Builder's
promptoutput here for grounded, character-aware captions. Blank falls back to "Describe this image in detail." - max_pixels_mp - the sleeper input. Default 1.0. This is the resolution limit sent to the model, and the tooltip is blunt: lower values drastically reduce time-to-first-token in llama.cpp. If captions feel slow, drop it.
- max_new_tokens, temperature, decoding, seed - standard generation knobs.
greedy_fastjust forces temperature to 0.0. Set a nonzero seed in sample mode to repeat results. - timeout - 120s default; raise it for slow hardware or very long
long_thoughtscaptions.
The output, caption, is a STRING - same destinations as the local Captioner: save it, preview it, or feed it back into your workflow.
Setting up the server
Install the pack (Manager search "ToriiGate", or git clone https://github.com/litch230/comfyui_toriigate.git into ComfyUI/custom_nodes), restart ComfyUI, then do the server dance from the README:
- Grab the latest llama.cpp release and pick the
win-cudazip matching your CUDA (orwin-vulkan/win-rocmfor AMD). - Download the matching
cudartzip from the same release page and extract it into the folder withllama-server.exe. Skip this and NVIDIA inference will be painfully slow - this is the most-missed step. - Run the server:
llama-server.exe [-m <model.gguf>] [--mmproj <mmproj.gguf>] -b 2048 -ub 1024 -fa on -fit on -fitt 1024 -ngl 999
Leave off -m and --mmproj and the node will instruct the server to download the right GGUF automatically on first use. -ngl 999 offloads everything to the GPU. Once you see the server listening on http://127.0.0.1:8080, you're set.
Common issues
- "Cannot connect to llama-server" - it's not running, or the URL is wrong. The error message says exactly that. Start the server, then re-run.
- Horribly slow on NVIDIA - you skipped the cudart zip. Re-read step 2.
- "Model not found" on the request - the
repo:quantidentifier doesn't match what the router registered. Match it in the dropdown or override withcustom_model_name. - Timeout on long captions - raise
timeoutand/or trimmax_new_tokens.
If you're captioning batches and have a GPU worth the name, this is the node to reach for over the local Captioner. The one-time server setup buys you speed and VRAM headroom every run after.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | ComfyUI image tensor (B, H, W, C float32). Only the first image in the batch is sent. | |
| server_url | STRING | http://127.0.0.1:8080 | Base URL of the llama-server instance. Example: http://127.0.0.1:8080 |
| model_name | COMBO | DraconicDragon/ToriiGate-0.5-GGUF:Q4_K_M | GGUF quantization to use. The identifier must match what the llama-server router registered (shown at startup as 'operator(): ...'). Q4_K_M is the recommended balance of quality vs size (3.07 GB). Use custom_model_name below to override with any arbitrary string. |
| timeout | FLOAT | 1205–600 | HTTP request timeout in seconds. Increase for slow hardware or very long generations. |
| custom_model_nameopt | STRING | Override the model identifier with any custom string. Useful when running a non-GGUF backend or a locally renamed model. Leave blank to use the dropdown above. | |
| promptopt | STRING | Optional prompt. You can connect the text output from the ToriiGate Grounding Builder here, or type your own. | |
| max_pixels_mpopt | FLOAT | 1.00.1–8 | Resolution limit sent to the model, in megapixels. Lower values drastically reduce prompt evaluation time (Time To First Token) in llama.cpp. |
| max_new_tokensopt | INT | 51264–8192 | Maximum generated tokens. |
| temperatureopt | FLOAT | 0.500–2 | Generation randomness. 0 is deterministic. |
| decodingopt | COMBO | sample | sample uses temperature-based sampling; greedy_fast sets temperature to 0.0. |
| seedopt | INT | 00–18446744073709550000 | Seed for reproducibility. Use 0 for a random seed. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| caption | STRING | — |