comfyui_toriigate
ComfyUI custom nodes for ToriiGate-0.5, an image captioning model for anime-style and digital art.
Nodes (4)
Real captions for anime art, fully local
Tell the captioner who's who before it looks
The chat port you'll mostly use to test the server
The fast path to anime captions
comfyui_toriigate
ComfyUI custom nodes for Minthy/ToriiGate-0.5, an image captioning model for anime-style and digital art.
Original Model: Minthy/ToriiGate-0.5 GGUF Models: DraconicDragon/ToriiGate-0.5-GGUF
Installation
Clone this repository into your ComfyUI/custom_nodes folder:
cd ComfyUI/custom_nodes
git clone https://github.com/litch230/comfyui_toriigate.git
If you plan to use the local Transformers node instead of the API, install the requirements:
# Standard Python / venv
pip install -r ComfyUI/custom_nodes/comfyui_toriigate/requirements.txt
# ComfyUI Portable (Windows)
python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\comfyui_toriigate\requirements.txt
Usage Methods
This node pack provides two different ways to run ToriiGate.
1. Llama.cpp API (Recommended)
Connects to an external llama-server.exe running a GGUF version of the model.
- Node:
ToriiGate Llama.cpp Vision Generate - Model format:
.ggufonly - Pros: Much faster inference, lower VRAM usage, bypasses python dependency issues.
- Cons: You need to run the llama-server manually before starting ComfyUI.
2. Transformers / PyTorch (Local)
Runs the model natively inside ComfyUI using the transformers library.
- Node:
ToriiGate Captioner - Model format: Original unquantized HuggingFace model format (cannot run GGUF).
- Pros: No external server needed.
- Cons: Slower, uses more VRAM.
Running the Llama.cpp Server
For the best performance on NVIDIA GPUs, follow these steps to run the API server:
-
Download the latest release from the llama.cpp releases page.
- Choose the
win-cudazip matching your CUDA version (e.g.llama-b4109-bin-win-cuda-12.4-x64.zip). - If you have an AMD GPU, use
win-vulkanorwin-rocm.
- Choose the
-
Download the
cudartzip file from the same release page (e.g.cudart-llama-bin-win-cuda-12.4-x64.zip).- Extract the
cudartfiles directly into the same folder where you extractedllama-server.exe. Without this, inference on NVIDIA GPUs will be very slow.
- Extract the
-
Open CMD in that folder and run the server with the following optimizations. (Note: The
-mand--mmprojflags are optional if you want to preload local files; if omitted, the ComfyUI node will automatically instruct the server to download and load the correct GGUF model):
llama-server.exe [-m <model.gguf>] [--mmproj <mmproj.gguf>] -b 2048 -ub 1024 -fa on -fit on -fitt 1024 -ngl 999
Command breakdown:
-m: (Optional) Path to your downloaded.gguflanguage model.--mmproj: (Optional) Path to your downloaded.ggufvision projector model (required if preloading a vision model locally).-b 2048 -ub 1024: Batch sizes.-fa on: Enables Flash Attention.-fit on -fitt 1024: Speeds up image processing.-ngl 999: Offloads all layers to the GPU.
Once the server is running on http://127.0.0.1:8080, you can generate captions using the ToriiGate Llama.cpp Vision Generate node in ComfyUI.
Node Reference
- ToriiGate Grounding Builder: Compiles tags, characters, and descriptions into the final prompt string needed by the generator nodes.
- ToriiGate Captioner: Local PyTorch generator. Takes the image and the prompt string.
- ToriiGate Llama.cpp Vision Generate: API generator. Connects to
llama-serverand passes the image and prompt string. - ToriiGate Llama.cpp Text Generate: Text-only node for chatting with the model.