Ollama Generate
Talk to a Local LLM From Inside Your Graph
- messages
- messages
- response
Ollama Generate is the payoff node of this pack's two-node LLM section: it takes a chat history, sends it to a local Ollama server, and hands you the reply as a plain string. That string can go anywhere text can - a prompt encoder, a filename prefix, a wildcard processor, another LLM call. The whole thing stays local, costs nothing per call, and needs no API key.
People put Ollama inside ComfyUI for exactly this kind of plumbing: prompt enhancement before the sampler, character-consistency system prompts, even RPG-style wildcard substitution. The workflow genre is "LLM thinks, then ComfyUI renders." This node is the "LLM thinks" half.
How it works
It's a thin wrapper around Ollama's /api/chat endpoint. The node POSTs the message list to {host}/api/chat with stream off (so it waits for the full reply rather than a token stream), passes your seed through as an option, and asks the server to keep the model warm for 10 seconds after the call - enough to make consecutive generations snappy without pinning VRAM forever. It returns two things: the full message list with the assistant's reply appended, and the reply text by itself.
The inputs and outputs
- messages (
MESSAGE[]) - the chat history, built with the pack's Ollama Message nodes. - model (STRING, default
mistral) - which model to call. It must already exist on your Ollama server (ollama pull mistralif not). - seed (INT) - passed to Ollama for reproducible generations.
- host (STRING, default
http://ollama:11434) - where Ollama lives. This default is a Docker service name, not localhost. That's the single most common gotcha in this pack.
Outputs:
- messages (
MESSAGE[]) - the input history plus the assistant reply, so you can chain another turn. - response (STRING) - the assistant's answer. Wire this into your text node of choice.
The node also displays the response in its own UI panel, which is handy for a quick sanity check.
Where people get burned
- The host default. On a normal desktop install, change
hosttohttp://localhost:11434. Leave it ashttp://ollama:11434- the name of the container from the author's Docker setup - and the request just fails to connect. - Model not found. The default model is
mistral. If your Ollama server doesn't have it pulled, you get an error immediately. Runollama listto see what you've got, then set the model input accordingly. - Ollama isn't running at all. This node is a client. No
ollama serve, no reply. Check the server is up before debugging the node itself. MESSAGE[]is a pack-local type. The chat history only plugs into this pack's own nodes (Ollama Message and Ollama Generate). You can't wire someone else's message list in without adapting it.
Install
Install with ComfyUI Manager (search ComfyUI-Vivax-Nodes) or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/vivax3794/ComfyUI-Vivax-Nodes
then restart ComfyUI. The pack's only Python dependency is rich; the actual HTTP calls use requests, which ships with ComfyUI. You also need a running Ollama install and at least one pulled model - that's external to ComfyUI, not something the pack downloads for you. Single-author pack, small codebase; the usual skim-the-repo-before-installing advice applies.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| messages | MESSAGE[] | — | |
| model | STRING | mistral | — |
| seed | INT | — | |
| host | STRING | http://ollama:11434 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| messages | MESSAGE[] | — |
| response | STRING | — |