Ollama Generate
Have a local LLM write (or read) something inside your ComfyUI graph
- connectivity
- options
- images
- context
- meta
- result
- thinking
- context
- meta
This is the node people mean when they say "I hooked an LLM up to ComfyUI." Confusingly its class name is OllamaGenerateV2, but in the UI it just shows up as Ollama Generate - the plain "OllamaGenerate" name is taken by an older, deprecated node that this one replaced. Don't let that trip you up when you're searching the node menu.
What it actually does is simple: you write a system prompt and a user prompt, it ships them off to a model running on an Ollama server, and the model's answer comes back as a string you can route anywhere - into a Show Text node, into a CLIP Text Encode via a helper node, into a file. This is how a lot of "let the LLM write my prompt" workflows are built now, and that's not a fringe use case anymore - corpus mentions of "prompt enhancer" went from 12 in 2023 to 253 in the first half of 2026. It used to be a browser-tab habit; now it's a node.
How it works
OllamaGenerateV2 doesn't run any model itself. It's a thin client that sends a request to whatever server you point it at and waits for the response. That means it needs to know two things before it can do anything: where the server is, and which model to use. You give it that either through a connectivity input (an OllamaConnectivityV2 node) or a meta input carried over from another Generate node further up the chain. The README says it plainly: for this node to be operational, connectivity or meta must be set - leave both empty and it just can't run.
Inputs and outputs that matter
systemandprompt(both multiline strings) are the two you'll actually type into. System sets the role/behavior, prompt is the actual ask. For vision tasks, the tooltip suggests phrasing like "describe this image in detail" and referring to the input as "this image."think- turns on a reasoning pass before the answer. Can improve accuracy, but only works on models trained for it; flip it on with an ordinary chat model and generation just fails.images(optional) - plug in an image (or batch) for vision tasks. Ollama will still answer if the model can't actually see, it'll just hallucinate a description, so make sure you picked a vision-capable model.context(optional, typeOLLAMA_CONTEXT) - carries a running conversation state from a previous Generate call, for multi-turn follow-ups.meta(optional) - the chaining input. Wire one Generate node'smetaoutput into the next node'smetainput and the connectivity + options settings ride along automatically, so you're not re-plugging the same server into five nodes. One gotcha straight from the pack's own docs: if you're feeding images and chaining via meta, the images need to be re-supplied on each node in the chain - meta doesn't carry them.- Outputs:
result(the answer),thinking(the reasoning trace, ifthinkwas on),contextandmetato pass forward.
Installing it
Easiest path is ComfyUI Manager: search comfyui-ollama (by Stav Sapir) or just ollama and pick the one from stavsap. Manually, it's:
cd ComfyUI/custom_nodes
git clone https://github.com/stavsap/comfyui-ollama
pip install -r requirements.txt
then restart ComfyUI. The pip install here is light - it's the ollama Python client, not a model. The actual weight is on your Ollama server, which is a separate install entirely (curl script on Linux, the desktop app on Mac/Windows, or a Docker container) - pull at least one model on it (ollama pull llama3 or similar) before you expect the node's model dropdown to show anything.
Common issues
"Value not in list: model." This is the most common complaint in the wild for this whole node family. The model field is a dropdown baked in at the time the node/workflow was saved. Load a workflow someone else shared, or reopen your own after pulling different models, and the saved model name won't match what's actually on your server - ComfyUI refuses to run it. Fix: reselect the model from the dropdown (it repopulates live from your server), or delete and re-add the connectivity node if it's stuck.
VRAM contention with your diffusion model. Ollama keeps the LLM loaded for keep_alive minutes after each call, and that memory comes out of the same GPU your SD model wants. If you're tight on VRAM, run Ollama on a separate machine, or drop keep_alive low so it unloads between generations.
think fails outright. Not every model supports a reasoning pass - if enabling it breaks generation, turn it off or switch models.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| system | STRING | You are an AI artist. | System prompt - use this to set the role and general behavior of the model. |
| prompt | STRING | What is art? | User prompt - a question or task you want the model to answer or perform. For vision tasks, you can refer to the input image as 'this image', 'photo' etc. like 'Describe this image in detail' |
| think | BOOLEAN | false | If enabled, the model will do a thinking process before answering. This can result in more accurate results. The thinking is then available as a separate output for debugging or understanding how the model arrived at its answer. Some models don't support this feature and the generation will fail. |
| keep_context | BOOLEAN | false | If enabled, the model will keep the context of the conversation and use it for the next generation. This is useful for multi-turn conversations or tasks that require context. |
| format | COMBO | Output format of the response. 'text' will return a plain text response, while 'json' will return a structured response in JSON format. This is useful when the model is part of a larger pipeline and you need additional processing on the response. In this case I recommend showing the model example outputs in the system prompt. Some models are not trained to perform well in structured output. | |
| connectivityopt | OLLAMA_CONNECTIVITY | Set an ollama provider for the generation. If this input is empty, the 'meta' input must be set. | |
| optionsopt | OLLAMA_OPTIONS | Connect an Ollama Options node for advanced inference configuration. | |
| imagesopt | IMAGE | Provide an image or a batch of images for vision tasks. Make sure that the selected model supports vision, otherwise it may hallucinate the response. | |
| contextopt | OLLAMA_CONTEXT | Optionally set an existing model context, useful for multi-turn conversations, follow-up questions. | |
| metaopt | OLLAMA_META | Use this input to chain multiple 'Ollama Generate' nodes. In this case the connectivity and options inputs are passed along. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |
| thinking | STRING | — |
| context | OLLAMA_CONTEXT | — |
| meta | OLLAMA_META | — |