OllamaEnhancerNode
Turn Ollama into your prompt writer — no API key, no cloud
- clip
- positive
- negative
You type "a girl in a forest at sunset" and this node hands your sampler a polished paragraph plus a solid negative list - and it never touches the internet to do it. OllamaEnhancerNode is a small node from the efortin/ComfyUI-Ollama-Enhancer pack (registered as "ComfyUI-Manufnode") that runs your prompt through a local LLM, asks it to write better positive and negative prompts, and encodes both straight into CONDITIONING. No API key, no OpenAI bill, no leaking your prompts to a third party. If you already run Ollama for chat, this is the least-friction way to make it useful for image generation.
Where it fits - and where it won't. This is a CLIP-era tool. It takes a CLIP model in and emits CONDITIONING, so it's right at home feeding SDXL, Illustrious, Pony, or Flux.1. It will not help with the 2026 LLM-encoded models (Z-Image, Flux 2 Dev, Klein, Anima) - those don't encode through CLIP and don't have a negative prompt to fill. Keep it on the SDXL lineage and it earns its keep; the negative prompt is alive and well there, even as it's died on the newer stuff.
How it works
On every run, the node grabs your user_prompt, drops it into the bundled prompt.jinja template ("You are a prompt engineer for Stable Diffusion XL… return STRICT JSON"), and sends it to Ollama via the ollama Python client. It expects back JSON with two lists - positive_text and negative_text. Then:
- Positive is the model's
positive_textjoined into a sentence, unlessenhance_positiveis false, in which case your raw prompt goes through untouched. - Negative is the model's
negative_textunioned with a hardcoded ~30-term blocklist the author baked in (extra heads,extra limbs,watermark,lowres,blurry…). - Both get encoded through your
clipinput (encode_from_tokenswithreturn_pooled) and come out the two outputs,positiveandnegative.
Here's the thing I like: it fails safe. If Ollama is down, the model returns non-JSON, or the fallback model isn't pulled, it doesn't crash your queue - it just encodes your raw prompt plus the built-in negatives and carries on. Worst case you get an unenhanced image instead of a red graph.
The inputs that matter
ollama_url- the one that will bite you. The default ishttp://ollama:11434, which is a Docker-Compose service name, not a desktop address. On a normal install, change it tohttp://localhost:11434or the address of your Ollama server.user_prompt- what you'd normally type into a CLIPTextEncode node.enhance_positive- flip to false if the LLM keeps mangling your idea; it still builds the negative.reuse_running_model- when true (the default), the node uses whatever model Ollama currently has loaded, whatever that is. Yourfallback_model(llama3.2:3bby default) andfallback_force_cpuonly kick in when nothing's running. Force CPU applies just to the fallback, not a reused model.
One honest quibble: the seed input is cosmetic. Reading the source, it's logged and never forwarded to Ollama's generation options, so don't expect reproducible expansions from it.
Installing
Grab it through ComfyUI Manager (search "Ollama Enhancer" or "Manufnode"), or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/efortin/ComfyUI-Ollama-Enhancer
cd ComfyUI-Ollama-Enhancer
pip install -r requirements.txt
Then restart ComfyUI. It needs an Ollama server (with a model pulled - ollama pull llama3.2:3b if you want the fallback to work) and Python 3.11+. The only real dependency is the ollama client library.
Gotchas
The template's flavor text says "Stable Diffusion XL" even when you use it with Flux - it works, but the style cues lean SDXL/anime, so your output will too. Also, this runs synchronously and uncached: every queue run is another LLM inference. If you're iterating on a prompt, run it once, save the output text, and reuse it - don't pay for the same expansion forty times. And if the model drifts and adds subjects you never asked for, that's the classic enhancer failure; enhance_positive = false is your escape hatch.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| user_prompt | STRING | — | |
| ollama_url | STRING | http://ollama:11434 | — |
| template_path | STRING | prompt.jinja | — |
| enhance_positive | COMBO | true | 2 options: true, false |
| reuse_running_model | COMBO | true | 2 options: true, false |
| fallback_model | STRING | llama3.2:3b | — |
| fallback_force_cpu | COMBO | true | 2 options: true, false |
| seed | INT | 00–4294967295 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |