Nodes/Ollama Prompt Encode/Ollama CLIP Prompt Encode
ComfyUI Node

Ollama CLIP Prompt Encode

Your next prompt, ghostwritten by a local LLM — then CLIP-encoded in one node

By ScreamingHawk·Created 2 years ago·Updated 2 years ago· 17
Ollama CLIP Prompt Encode
  • clip
  • conditioning
  • prompt
ollama_urlhttp://localhost:11434
ollama_modelorca-mini
seed0
prepend_tags
text
comma_separated_responsetrue

Somewhere between your hundredth "young woman, detailed face" and the workflow you abandoned because you ran out of adjectives, you've probably wished the image model would just read your mind. This node is the pragmatic middle ground: you type one lazy sentence about what you want, a local LLM expands it into a proper prompt, and the same node runs it through CLIP and hands you ready-made conditioning. One node replaces the whole "think of prompt → write prompt → CLIP Text Encode" chain.

It's the Ollama CLIP Prompt Encode node from the comfyui-ollama-prompt-encode pack by Michael Standen (ScreamingHawk), and it's designed as a drop-in for ComfyUI's stock CLIP Text Encode (Prompt). Being the one who writes this in 2026, I'll say the obvious thing up front: LLM-assisted prompting is no longer a gimmick - it went from 12 corpus mentions in 2023 to a couple of hundred a year by 2026, because if your text encoder is an LLM reading instructions, having an LLM write those instructions is just translation. This pack was early to that party.

How it actually works

Despite the name, nothing here is hosted. The node is a thin HTTP client for Ollama - the local model server you install yourself. Before every generation it calls Ollama's pull on the model you picked, so the first run downloads it (a no-op after that), then it sends your text along with a system prompt and a few canned examples, and Ollama's model writes the prompt back. Your prompt is built as prepend_tags + ", " + the model's output, with full stops swapped for commas so it reads like tag soup instead of prose. Then it does what the default CLIP Text Encode does - tokenize, encode_from_tokens - and returns proper conditioning with the pooled output included, which means it's even safe for SDXL checkpoints that need it. That's the whole trick.

The defaults in the schema tell you the developer's intent: ollama_model defaults to orca-mini (small, fast, and long in the tooth - swap in whatever you've already pulled), ollama_url to http://localhost:11434, and comma_separated_response to on.

The inputs that matter

  • text - your one-line brief. "cheerleader in a gym, golden hour". The LLM does the embellishing.
  • ollama_model - any model you have in Ollama. Small beats smart here; you're waiting on every generation.
  • comma_separated_response - this is the one that decides whether your output is usable. Checked (default) produces dense comma-separated tags for Pony/Illustrious-style models; unchecked produces descriptive sentences that Flux-family models prefer. Wrong mode = muddy results, not an error.
  • prepend_tags - stuck in front of whatever the LLM writes. The README's own example is score_9, score_8_up for Pony, whose training made the full score-tag string mandatory for quality.
  • seed - nonzero makes the generation reproducible and pins temperature to 0; 0 sends no seed at all, so you get a fresh prompt every run.
  • clip - the CLIP model from your checkpoint loader.

Outputs: conditioning (wire into KSampler's positive input) and prompt - the generated string, which you can inspect with rgthree's Display Any or feed into a second encode for your negative. That's a legit workflow: same brief, one node for the positive, one for the negative.

Installing it

You need Ollama installed and running first - the node is useless without the service. Then, in ComfyUI Manager, search "Ollama Prompt Encode" and hit Install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/ScreamingHawk/comfyui-ollama-prompt-encode

then restart ComfyUI. The only Python dependency is ollama==0.4.2 (pinned, but the chat API it talks to has stayed stable), and the pack was tested against Ollama server 0.4.6. It's MIT licensed, and old - last touched in late 2024 - but nothing here has rotted.

Where people get burned

Ollama isn't running. The #1 failure. You get a connection error the moment you queue the job. Start the Ollama app or ollama serve, then retry.

The 60-second timeout. Every generation is wrapped in a hard 60-second timeout in the source. A big model cold-starting, or your GPU busy with the sampler, and it dies with timeout exceeded. This is why the README pushes small models - orca-mini and tinyllama are deliberate choices.

First run stalls. The auto-pull downloads the model before generating. A 3B model is quick; something llama-70B-sized isn't.

CLIP eats your prompt. The LLM happily writes 200 tokens; CLIP caps at 77 per encoder (two on SDXL). Tag mode keeps output dense enough to survive; long descriptive mode can get truncated right when it gets interesting.

Seed 0 means random. Not "seed 0". No seed is sent, so identical inputs give different prompts every run. Set a nonzero seed when you finally land on a prompt you like.

CategoryOllama

Inputs (7)

NameTypeDefaultDescription
clipCLIP
ollama_urlSTRINGhttp://localhost:11434
ollama_modelSTRINGorca-mini
seedINT00–18446744073709550000
prepend_tagsSTRING
textSTRING
comma_separated_responseBOOLEANtrue

Outputs (2)

NameTypeDescription
conditioningCONDITIONING
promptSTRING