Nodes/comfyui-OreX/🦙 Ollama (OreX)
ComfyUI Node

🦙 Ollama (OreX)

A local LLM node that never asks for an API key

By orex2121·Created 2 years ago·Updated about 6 hours ago· 53
🦙 Ollama (OreX)
  • image
  • Generated Text
  • Request_ollama
◄text_input►
◄system_prompt►
◄system_preset▾►
◄model_key▾►
◄include_reasoningfalse►
◄auto_unload_modeltrue►
◄unload_delay0►
◄clean_vram_beforefalse►
◄seed777►
◄context_length4096►
◄max_tokens0►
◄generation_parametersfalse►
◄temperature0.70►
◄top_k40►
◄top_p0.95►
◄repeat_penalty1.10►

The name is a lie in the best way: this node doesn't need any API key, cloud account, or hosted service. It calls Ollama - the local LLM runner - which you already run on the same machine at http://127.0.0.1:11434. Everything stays on your box, which makes it the natural partner for the Kontext Presets node or any "let an LLM write my prompt" workflow. Feed it text, get back generated text; wire that into a text encoder or a Kontext edit workflow and you have a fully local prompt-pipeline.

How it works

Under the hood it's a thin client for Ollama's REST API. On startup it hits /api/tags and fills the model_key dropdown with whatever models you've actually pulled (ollama list), so no typing model names by hand. When you run the queue it posts to /api/chat with your system prompt, user text, and generation options, then returns the model's reply.

Three things make it friendlier than a raw API call:

  • Vision without a second tool. Plug an IMAGE into the optional image input and the node base64-encodes it as JPEG and sends it as an image message - but only after downscaling it to about 0.7 megapixels. That's a smart default; huge images waste context and often trip the vision encoder anyway.
  • Thinking-tag cleanup. If you're on a reasoning model (DeepSeek R1 style), include_reasoning off (the default) strips <think>, <channel>, and [Thinking ...] blocks so you get the answer, not the model's internal monologue. Turn it on if you actually want to see the reasoning.
  • VRAM diplomacy. Ollama and ComfyUI both want your GPU. clean_vram_before unloads ComfyUI's models before generating, and auto_unload_model (with unload_delay) tells Ollama to drop the model from VRAM when it's done - keep_alive: 0 by default. On a 8–16 GB card this is the difference between "it works" and "CUDA out of memory."

The inputs that matter

You set maybe half a dozen things as a beginner:

  • model_key - pick your pulled model; the dropdown is live, not hardcoded.
  • text_input - your request. With an image plugged in, it can be empty (it'll ask the model to describe the image).
  • system_preset - a small built-in list (translators, "short answer", Ideogram/Boogu image-sysprompts) appended to your own system_prompt.
  • seed - set for reproducible outputs; Ollama otherwise rolls the dice every run.
  • Optional temperature, top_k, top_p, repeat_penalty - only sent to the API when generation_parameters is on, so defaults from Ollama's own config apply otherwise.

Outputs: Generated Text (the model's reply - what you actually wire onward) and Request_ollama, a JSON dump of the full request for debugging. That second one is a gift when something silently misbehaves; paste it and you'll see exactly what the node sent.

Install

From ComfyUI Manager (search "comfyui-OreX") or:

cd ComfyUI/custom_nodes
git clone https://github.com/orex2121/comfyui-OreX

Restart, then make sure Ollama is installed and running separately (ollama serve), and pull a model you want: ollama pull qwen2.5:7b is a solid first choice. The node reads the OLLAMA_URL environment variable if your Ollama lives on another host or port.

Common issues

  • "SELECT A MODEL" stuck in the dropdown - the node couldn't reach /api/tags at startup. Is Ollama actually running? Restart ComfyUI after starting it; the list is fetched when the node loads.
  • "Connection failed" on run - same story, or a different port. Set OLLAMA_URL=http://your-host:11434 and restart.
  • Empty output / only thinking text - a reasoning model with include_reasoning off and nothing left after cleanup; the node even appends a Russian warning that the model only produced reasoning. Switch models or enable reasoning.
  • OOM with both running - enable clean_vram_before and auto_unload_model; on a small card keep unload_delay at 0 so Ollama unloads immediately after each call.
Category🤫OreX/LLM

Inputs (17)

NameTypeDefaultDescription
text_inputSTRING—
system_promptSTRING—
system_presetCOMBO8 options: None, Image Description, English translator, Translator into Russian, Translation into Chinese, Short answer, +2
model_keyCOMBO1 options: SELECT A MODEL
include_reasoningBOOLEANfalse—
auto_unload_modelBOOLEANtrue—
unload_delayINT00–3600—
clean_vram_beforeBOOLEANfalse—
seedINT7770–18446744073709550000—
imageoptIMAGE—
context_lengthoptINT40960–131072—
max_tokensoptINT00–18446744073709550000—
generation_parametersoptBOOLEANfalse—
temperatureoptFLOAT0.700–2—
top_koptINT400–100—
top_poptFLOAT0.950–1—
repeat_penaltyoptFLOAT1.100–2—

Outputs (2)

NameTypeDescription
Generated TextSTRING—
Request_ollamaSTRING—