Generate Text | Ollama Nodes
The Ollama node that reads your images — local, free, no API key
- context
- images
- options
- response
- model
- created_at
- done
- done_reason
- context
- total_duration
- load_duration
- prompt_eval_duration
- eval_count
- eval_duration
This is the whole reason the pack exists. GenerateOllama sends a prompt to a local Ollama model and gets text back - and because it takes an IMAGE input, it can look at your images and describe them. That makes it the best captioning / image2prompt shortcut in the pack, and the one you'll actually keep in a workflow. The name undersells it: "generate text" is the mechanism, "describe this render so I can use it as training data" is the job.
Why you'd reach for it
Three big uses, in order of popularity:
- Captioning for training. Feed it a batch of images and get detailed descriptions you can paste into LoRA training captions. This is the workflow the pack's README screenshot shows - batch image in, text out.
- Vision feedback in a pipeline. Ask it what's in the frame - lighting, mood, subject - and route that text into a prompt template for the next stage.
- Prompt enrichment. A handful of nodes in the ecosystem (like the Ollama-based enhancer that ships in ComfyUI-BerniniStudio) do this: plain idea in, detailed prompt out. Here you just change the system prompt to "expand this into a detailed image prompt."
The nice part, which r/comfyui posters consistently point out: it's fully local. No API key, no monthly bill, and Ollama unloads the model from VRAM after each call so your KSampler gets the memory back. That's a real advantage over calling a hosted vision API mid-workflow.
How it works
It calls ollama.generate on the Ollama server running at 127.0.0.1:11434. If you feed an images input, the node converts the tensor batch to PNG bytes and hands them to the model - which only works with a vision model. The default llava:latest is the classic choice; MiniCPM-V via Ollama is a popular alternative if you want more detail. The node always re-executes (it ignores caching), which is what you want when the input image changes.
The inputs that matter
model_name- which Ollama model to use. Defaultllava:latest. Text-only models work fine too; just leaveimagesunplugged.prompt- what you ask. Multiline. Default "Describe the images".system- the system prompt, multiline. The default is a decent detailed-description prompt (with a typo, "assitant", which you can ignore or fix). Tweak this to steer the style of your captions.images(optional) - anIMAGEtensor. Plug any image output here.format(optional) - setjsonto force structured JSON output, handy for feeding results into other nodes.context(optional) - the list of token IDs from a previousresponseoutput. Wirecontextfrom the last call back intocontextfor multi-turn chat.options(optional) - a dictionary of Ollama generation options (temperature,num_predict, etc.), passed through to the server.keep_alive(optional) -0(default) unloads the model right after generation to free VRAM;-1keeps it loaded for faster repeats. On a tight-VRAM card, leave it at 0.
The response output is the text you want. The other ten outputs - model, created_at, done, done_reason, context, total_duration, load_duration, prompt_eval_duration, eval_count, eval_duration - are Ollama's metadata (durations in nanoseconds, eval_count in tokens). Ignore them until you're benchmarking.
Getting it running
Two prerequisites. First, the pack itself: ComfyUI Manager → search "comfyui-ollama-nodes" → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/slyt/comfyui-ollama-nodes
cd comfyui-ollama-nodes
pip install -r requirements.txt
Second - the one people forget - Ollama must be running on the machine ComfyUI runs on (install from ollama.com). The pack assumes a server at 127.0.0.1:11434. Then pull a vision model once:
ollama pull llava
Troubleshooting
- "Connection refused" / nothing happens - Ollama isn't running or isn't on the same host as ComfyUI. If ComfyUI runs on a remote box, set
OLLAMA_HOSTand make sure the port is reachable. - Vision model ignores the image - you're using a text-only model like
llama3. Vision needsllava,minicpm-v, or similar. - Node executes instantly with empty output - check the console log; the pack logs each generate call, and the error will be there. Stream mode also drives a progress bar (the README notes ShowText can't do true token-by-token streaming yet).
Worth the install? Yes. If you train LoRAs or want a self-contained local "explain this image" node in your graph, this is the pack's flagship and it does the job.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | STRING | llava:latest | — |
| prompt | STRING | Describe the images | — |
| system | STRING | You are an AI assitant that describes images in great detail, focusing on the lighting, mood, scene, details, subjects, hues, and colors | — |
| stream | BOOLEAN | false | — |
| templateopt | STRING | — | |
| formatopt | STRING | — | |
| contextopt | LIST | — | |
| imagesopt | IMAGE | — | |
| optionsopt | DICTIONARY | [object Object] | — |
| keep_aliveopt | FLOAT | 0.00 | — |
Outputs (11)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| model | STRING | — |
| created_at | STRING | — |
| done | BOOLEAN | — |
| done_reason | STRING | — |
| context | LIST | — |
| total_duration | FLOAT | — |
| load_duration | FLOAT | — |
| prompt_eval_duration | FLOAT | — |
| eval_count | INT | — |
| eval_duration | FLOAT | — |