🦙 Ollama (OreX)
A local LLM node that never asks for an API key
- image
- Generated Text
- Request_ollama
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
imageinput 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_reasoningoff (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_beforeunloads ComfyUI's models before generating, andauto_unload_model(withunload_delay) tells Ollama to drop the model from VRAM when it's done -keep_alive: 0by 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 ownsystem_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 whengeneration_parametersis 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/tagsat 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:11434and restart. - Empty output / only thinking text - a reasoning model with
include_reasoningoff 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_beforeandauto_unload_model; on a small card keepunload_delayat 0 so Ollama unloads immediately after each call.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| text_input | STRING | — | |
| system_prompt | STRING | — | |
| system_preset | COMBO | 8 options: None, Image Description, English translator, Translator into Russian, Translation into Chinese, Short answer, +2 | |
| model_key | COMBO | 1 options: SELECT A MODEL | |
| include_reasoning | BOOLEAN | false | — |
| auto_unload_model | BOOLEAN | true | — |
| unload_delay | INT | 00–3600 | — |
| clean_vram_before | BOOLEAN | false | — |
| seed | INT | 7770–18446744073709550000 | — |
| imageopt | IMAGE | — | |
| context_lengthopt | INT | 40960–131072 | — |
| max_tokensopt | INT | 00–18446744073709550000 | — |
| generation_parametersopt | BOOLEAN | false | — |
| temperatureopt | FLOAT | 0.700–2 | — |
| top_kopt | INT | 400–100 | — |
| top_popt | FLOAT | 0.950–1 | — |
| repeat_penaltyopt | FLOAT | 1.100–2 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Generated Text | STRING | — |
| Request_ollama | STRING | — |