Nodes/comfyui_toriigate/ToriiGate Llama.cpp Text Generate
ComfyUI Node

ToriiGate Llama.cpp Text Generate

The chat port you'll mostly use to test the server

By litch230·Created 4 months ago·Updated 4 months ago· 20
ToriiGate Llama.cpp Text Generate
    • text
    promptDescribe the following topic in detail:
    server_urlhttp://127.0.0.1:8080
    model_nameDraconicDragon/ToriiGate-0.5-GGUF:Q4_K_M
    temperature0.70
    max_tokens512
    timeout120
    custom_model_name
    system_prompt

    Let's be straight with you: ToriiGate-0.5 is a captioning model, not a chatbot. Its own source notes say it's "designed for single-image captioning, not general chat or multi-turn use." So the ToriiGate Llama.cpp Text Generate node is the odd one out in this pack - a text-only chat endpoint against the same llama-server the vision nodes use, with no image involved at all.

    That doesn't make it useless. It's genuinely handy in two situations: as a way to verify your llama-server is up and responding before you burn time on a vision caption, and as a lightweight text side-channel when you're already running the server for the Vision Generate node. Just don't expect a capable assistant. Keep your expectations in line with a model that was fine-tuned to describe anime.

    How it works

    The node sends an OpenAI-compatible chat-completions request to your llama-server. That's it - no transformers, no torch model loading, no CUDA initialization. The pack's nodes_api.py builds a plain messages payload and POSTs it to {server_url}/v1/chat/completions, then hands back the response text. It only needs the requests library, so it dodges the whole heavy dependency stack the local Captioner requires.

    The inputs that matter

    • server_url - defaults to http://127.0.0.1:8080. Must point at a running llama-server, same as the vision node.
    • model_name - the GGUF identifier dropdown, defaulting to DraconicDragon/ToriiGate-0.5-GGUF:Q4_K_M. It has to match what the llama-server router registered at startup (shown as operator(): ...). If you renamed a local model or run a non-GGUF backend, use custom_model_name to override it with any string.
    • prompt - the user message, defaulting to "Describe the following topic in detail:".
    • system_prompt - optional; leave blank to skip the system turn. This is where you'd steer the model toward acting like a reasonable captioner rather than a confused chatbot.
    • temperature (0.7 default), max_tokens (512), timeout (120s) - standard knobs. Bump the timeout on slow hardware.

    The output is a single STRING, text, which you can route anywhere strings go - though realistically you'll mostly just read it in a preview node.

    Installing and running it

    Install comes with the pack - ComfyUI Manager (search "ToriiGate") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/litch230/comfyui_toriigate.git
    

    Then restart ComfyUI. Because this node talks to a remote server, you don't need the transformers/torch requirements at all - the only optional extra is requests if it isn't already in your environment (the node prints a clear pip install requests message if it's missing). What you do need is a running llama-server, per the pack's README:

    llama-server.exe [-m <model.gguf>] [--mmproj <mmproj.gguf>] -b 2048 -ub 1024 -fa on -fit on -fitt 1024 -ngl 999
    

    Common issues

    • Connection refused / timeout - the server isn't running, or the URL is wrong. The error message literally tells you to check that llama-server is up.
    • Model identifier mismatch - if the server preloaded a model with -m, the dropdown's repo:quant format may not match what the router registered. Use custom_model_name to match, or let the node request the GGUF by leaving -m off the server command.
    • Sluggish text - ToriiGate is a 4B captioner; it's not fast at prose. That's the model, not your setup.
    CategoryToriiGate/API

    Inputs (8)

    NameTypeDefaultDescription
    promptSTRINGDescribe the following topic in detail:User prompt sent to the llama-server.
    server_urlSTRINGhttp://127.0.0.1:8080Base URL of the llama-server instance. Example: http://127.0.0.1:8080
    model_nameCOMBODraconicDragon/ToriiGate-0.5-GGUF:Q4_K_MGGUF 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.
    temperatureFLOAT0.700–2Sampling temperature. 0 is deterministic (greedy); higher values introduce more randomness.
    max_tokensINT51216–8192Maximum number of tokens to generate.
    timeoutFLOAT1205–600HTTP request timeout in seconds. Increase for slow hardware or very long generations.
    custom_model_nameoptSTRINGOverride 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.
    system_promptoptSTRINGOptional system prompt. Leave blank to omit the system turn.

    Outputs (1)

    NameTypeDescription
    textSTRING