Set Ollama LLM Service Connector ๐
Point ComfyUI's LLM nodes at your local Ollama
- llm_service_connector
The MieNodes pack ships a family of Set*LLMServiceConnector nodes, one per LLM provider, and this is the local one. Want a small language model rewriting prompts, captioning images, or answering questions inside the graph - no subscription, nothing sent to a cloud API? This node is how you point all of that at your own Ollama install.
Get one thing straight before wiring anything: the name does extra work. Set Ollama LLM Service Connector doesn't call Ollama, doesn't generate text, and needs no API key. It's a configuration node in the ComfyUI sense - it packages host, model, and (irrelevant) token into an LLMServiceConnector handle for the pack's actual worker nodes. Its only output is llm_service_connector, which you feed into any node with an llm_service_connector input - Call LLM Service, the PromptGenerator family, the Kontext preset generator. The connector is plumbing, not the sink.
How it works
Mechanically it's simple and well-chosen. The node builds an object that posts to {host}/v1/chat/completions - Ollama's OpenAI-compatible endpoint, around since Ollama 0.3. Because Ollama ignores the Authorization: Bearer header (it only requires it to be non-empty), the node sends a placeholder token and api_token can stay empty or hold any junk. Leave model blank and it silently falls back to qwen2.5.
That's the "external server" pattern: Ollama runs as its own process and ComfyUI just talks HTTP to it - the opposite tradeoff from in-graph GGUF loaders that keep the model inside ComfyUI's VRAM budget. Two processes, and the diffusion model and the LLM share your card. Fine for prompt enhancement on a local 8B; don't expect a 32B and a Flux checkpoint to coexist happily.
The inputs that actually matter
Two fields to set, the rest ignored:
model- the name of a model you've actually pulled on the Ollama host (qwen2.5,llama3.2,llava,deepseek-r1,qwen2.5vl:7b). Free text, no dropdown. Empty =qwen2.5.host- the bare Ollama URL, defaulthttp://127.0.0.1:11434. Ollama on another LAN box?http://192.168.x.x:11434, withOLLAMA_HOST=0.0.0.0set on the server. Ollama in Docker, ComfyUI in another container?http://host.docker.internal:11434. No trailing slash, no/v1/...- that's appended for you.
The rest are mostly "set once, forget." api_token is a placeholder as covered above, and config_file, config_key, prefer_local_config are the pack's shared JSON-key plumbing - for Ollama there's no secret to store, so ignore them. The one worth knowing is timeout, default 60s. Ollama cold-starts a model from disk into VRAM on first call - 30โ90 seconds for a 7B+ - so if you run big models and the first request keeps timing out, bump it to 120โ180s. The base class retries on timeout; a longer single-attempt timeout just stops you wasting the first try.
Installing and wiring it
Install the pack the normal way: ComfyUI Manager โ search "MieNodes" (the pack title is ComfyUI_MieNodes) โ install, then restart. Manual route is the same as always:
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
Then restart ComfyUI. The pack's requirements.txt pulls a grab-bag of file/image utilities (opencv, imagehash, huggingface_hub, soundfile and friends) that its other nodes need - let it install. Ollama itself is a separate install; this node talks to it over HTTP, so make sure it's running with a model pulled:
# on the Ollama host, once
ollama pull qwen2.5
In the node graph: add Set Ollama LLM Service Connector (under ๐ MieNodes/๐ LLM Service Config), set the model name, add Call LLM Service, connect llm_service_connector โ llm_service_connector, type a prompt into input_text, and queue. The pack's workflows folder has ready-made examples of the connector feeding the prompt-enhancer and captioning nodes.
Gotchas worth knowing
- Connection refused on the call node almost always means Ollama isn't running or
hostis wrong. Openhttp://127.0.0.1:11434in a browser - no answer there, no answer here. - Model not found is a
modeltypo or a model you never pulled. Fix withollama pull <name>on the host. - First call hangs, then dies - that's cold start. Raise
timeout. Ollama-level knobs likenum_ctxandkeep_alivearen't exposed through the OpenAI-compat endpoint; tune those in a Modelfile on the host. - Vision models work (llava, qwen2.5vl): connect an
IMAGEtoCall LLM Service'simageinput and it's forwarded as inline data. - Reasoning models (deepseek-r1, qwen3) emit
<think>โฆ</think>chains before answering; the pack strips them, so no regexing them out of your prompt.
MieNodes is a small, content-creator-maintained pack that touches your network by design, so the usual custom-node rule applies: it's open source and on the registry, but glance at what you're running before wiring a fresh pack into a serious workflow. For the actual use case, this is about the cheapest prompt-enhancement setup you'll find - free, offline, uncensored, and it never asks for a key.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| host | STRING | http://127.0.0.1:11434 | โ |
| model | STRING | โ | |
| api_tokenopt | STRING | โ | |
| config_fileopt | STRING | mie_llm_keys.json | โ |
| config_keyopt | STRING | ollama | โ |
| prefer_local_configopt | BOOLEAN | true | โ |
| timeoutopt | INT | 601โ600 | Per-request HTTP timeout in seconds. Default 60s to absorb Ollama's cold-start cost (30-90s for 7B+ models). The base class retries on timeout, but a longer single-attempt timeout avoids the wasted retry. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| llm_service_connector | LLMServiceConnector | โ |