Call Ollama
Query a Local Ollama Model Without an API Key or a Cloud Bill
- response
The name is the truth, which is refreshing. Call Ollama sends your prompt to a model running in a local Ollama server - no cloud API, no key, no per-token bill. People wire LLMs into ComfyUI all the time as prompt-enrichment backends: you describe the image loosely and the model turns it into a detailed prompt before it hits the sampler. This node is the version of that which keeps everything on your machine.
The setup you need before it works
Two prerequisites, and if you skip either you'll get a wall of connection errors:
- Ollama installed and running on the same machine (
ollama serve- it listens onlocalhost:11434by default). - The model pulled.
ollama pull llama2or whatever you want to use. Themodel_namefield defaults tollama2, which isn't pulled by default on fresh installs.
Only then does the node matter. It calls ollama.chat() through the pack's ollama Python dependency, so it's a local HTTP call, not a ComfyUI-internal thing.
Inputs and output
model_name(STRING, defaultllama2) - the Ollama model tag.prompt(STRING) - what you're asking.temperature(FLOAT, default 0.6, range 0–1) - creativity knob.max_tokens(INT, default 2048) - response length cap.- Optional:
image_path(STRING) orimage_base64(STRING) - for vision models (llava, Qwen2-VL and friends), one of these carries the image. - Output:
response(STRING) - the model's reply, which you can pipe into a text encoder or a show-text node.
The think-style models get handled with heavier context settings behind the scenes; the node's defaults (top_p, top_k, num_ctx, repeat_penalty) differ depending on whether you're talking to a reasoning model. You don't set those - they're baked in.
Install
This is the one Sagado node with a real runtime dependency beyond the basics. The pack's requirements.txt includes ollama, so:
cd ComfyUI/custom_nodes
git clone https://github.com/5agado/ComfyUI-Sagado-Nodes
pip install -r ComfyUI-Sagado-Nodes/requirements.txt
Restart, then install Ollama itself from ollama.com if you haven't. Or use ComfyUI Manager → "Sagado Nodes for ComfyUI" for the clone.
Where people get burned
The error message you'll meet is Error getting LLM response, and 90% of the time it's one of the two prerequisites above: Ollama isn't running, or the model name isn't pulled (ollama list to check). The other gotcha is the vision inputs - pass both image_path and image_base64 and you only need one; they're alternatives, not both-required. And remember VRAM: unlike a cloud API, this model lives on your GPU. It loads to generate your prompt, and a local Ollama run typically doesn't hold VRAM while the sampler runs, but a big model can still compete with your checkpoint for space. Keep the model small if you're on a tight card.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | STRING | llama2 | — |
| prompt | STRING | — | |
| temperature | FLOAT | 0.60–1 | — |
| max_tokens | INT | 2048-1–32000 | — |
| think | BOOLEAN | false | — |
| image_pathopt | STRING | — | |
| image_base64opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |