Nodes/ComfyUI-LLMNodes/Ollama Server
ComfyUI Node

Ollama Server

It just hands you a URL (Ollama does the rest)

By LatentGEN·Created 9 months ago·Updated 9 months ago· 0
Ollama Server
    • server_url
    host127.0.0.1
    port11434

    Let's clear this up fast, because the name overpromises: Ollama Server does not start Ollama. It doesn't spawn a process, check a port, or verify anything is alive. All it does is build the string http://127.0.0.1:11434 - or whatever host and port you type - and return it as server_url. The docstring in the source even claims it starts a llama.cpp server; the code is two lines that format a URL. If Ollama isn't already running on that address, this node will not tell you. Your first clue will be an error in whatever node talks to that URL next.

    Which sounds useless, but there's a real reason it exists: it parameterizes the workflow. Ollama's default port is 11434, so without this node the other nodes in the pack would just hardcode http://127.0.0.1:11434 everywhere. This node lets you change host or port in one place - say, when Ollama runs on a different machine on your LAN, or on a non-default port - and every generate/caption node downstream picks up the change. It's a constant-in-a-node, not a service manager.

    The two inputs and one output

    • host - default 127.0.0.1. If Ollama runs on another box, use its LAN IP or hostname.
    • port - default 11434, which is Ollama's standard port, so you rarely touch it.

    Output: server_url, which you wire into the pack's Ollama generate and caption nodes. Those are the nodes that actually do something: they hit {server_url}/api/chat, and for the vision side they base64-encode images into the request so a multimodal model can caption them.

    The actual setup is outside ComfyUI

    Because this node starts nothing, your real work happens before it: install the Ollama binary (it's a standalone app, not a pip package - the pack can't install it for you), run ollama serve or start the desktop app, and pull a model:

    ollama serve
    ollama pull qwen2.5:7b
    

    That last command is also a reminder of the security posture worth keeping in mind for any LLM node. This pack is small and its network calls are all to localhost - I read the source and there's no phone-home, no auto-download, no external endpoint. That's reassuring, especially given the ecosystem's one big LLM-node malware incident. But it's also the kind of check you should do for every new node pack: it's arbitrary Python with full user-level access, and this one is brand new with an empty README and no community footprint behind the author. A couple of minutes reading the code (it's all of four files) is cheap insurance.

    Why use Ollama at all?

    It's the easiest local-LLM on-ramp there is: install one app, one ollama pull, done - no wheel compilation, no GGUF path management, and Ollama handles GPU offload itself. That's the trade against the pack's llama.cpp path, which is faster to tune but demands you install llama-cpp-python and point at a GGUF yourself. The community consensus in the KB frames this as the "external server the node talks to" pattern - and yes, the field is drifting toward in-graph GGUF loaders - but for most people who just want an LLM writing prompts or captioning images, Ollama is the path of least resistance.

    Installing the pack

    ComfyUI Manager: Custom Nodes Manager → search ComfyUI-LLMNodes → install. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/LatentGEN/ComfyUI-LLMNodes
    

    Restart ComfyUI. The pack ships with an empty requirements.txt, and this node needs nothing from pip - just Ollama itself on your system.

    Troubleshooting

    • Generate node errors while this one "works" - that's the design. Ollama isn't running, or ollama pull hasn't been run for the model you selected. Start Ollama and check ollama list.
    • Connection refused - Ollama isn't serving on that host/port. Verify the address here matches where ollama serve actually listens.
    • Different machine - change host to the machine's LAN IP, and make sure Ollama there is listening on a reachable interface, not just loopback.

    One node that formats a string - that's the whole honest summary. Handy as a workflow constant, misleading as a name, and completely dependent on Ollama doing the heavy lifting outside the graph.

    CategoryLLM /Ollama

    Inputs (2)

    NameTypeDefaultDescription
    hostSTRING127.0.0.1
    portINT114341–65535

    Outputs (1)

    NameTypeDescription
    server_urlSTRING