Nodes/kontext-super-prompt/🦙 Ollama Service Manager
ComfyUI Node

🦙 Ollama Service Manager

Start, stop, and babysit Ollama without ever leaving ComfyUI

By aiaiaikkk·Created about a year ago·Updated 12 months ago· 175
🦙 Ollama Service Manager
    • status

    OllamaServiceManager (🦙 Ollama Service Manager) is a small control panel for your Ollama instance that lives inside ComfyUI. It checks whether Ollama is running, and gives you buttons to start it, stop it, and unload its models to free memory - so you don't have to tab out to a terminal every time the prompt generator downstream reports "service not running".

    It's a utility node, not a thinking node. It doesn't generate anything and it won't make your prompts better. What it saves you is the most common failure mode of this whole pack: the Ollama-powered nodes silently fall back to canned templates when the service is down, and you waste a run wondering why the output is so generic. This node makes the status visible.

    How it works

    It detects the service in two ways: it pings Ollama's /api/tags endpoint on port 11434, and if that fails it scans running processes for an ollama serve process. If Ollama is installed but not running, the start button launches ollama serve as a subprocess with OLLAMA_HOST=0.0.0.0:11434 and CUDA_VISIBLE_DEVICES=0 (GPU 0 for inference), waits up to ten seconds, and reports success or timeout. The stop button terminates the serve processes, and the unload feature calls Ollama's keep_alive: 0 API to drop models out of memory when your VRAM/RAM budget is tight. The UI polls every five seconds, so the status label is roughly live.

    Inputs and outputs

    There are no inputs to set - the whole thing is buttons. It outputs a single status string (STRING) like "Ollama服务状态: 运行中" (running) or "已停止" (stopped), which you can display or feed into logic if you're building an automated workflow. It's an output node, so it's meant to sit at the end of your graph as a monitor, not feed anything important.

    Installing it

    Same pack as everything else here: ComfyUI Manager → search "Kontext Super Prompt", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/aiaiaikkk/super-prompt-canvas
    

    then restart ComfyUI. Ollama itself must be installed separately (ollama.com) and on your PATH - the node spawns ollama as a command, so a GUI-only install where it isn't in PATH will fail with an "Ollama not installed" message. The process-scanning code uses psutil, which ComfyUI already ships.

    Where people get burned

    The big one: starting a second Ollama instance when one is already running. The node tries to detect an existing service first, but if Ollama was launched with custom flags or is managed by your OS (a systemd service on Linux), the node can't see it and may spawn a duplicate that fights over the same models directory. The status string is in Chinese by default (running/stopped), which takes a second to parse if you don't read it. And OLLAMA_ORIGINS='*' - which the start routine sets to allow browser access - is broad; fine on a local box, but don't expose that port to the network. Honestly, if Ollama is already set up as a proper service, you may not need this node at all; it shines exactly when you want one-click control from the canvas.

    Category🎨 Super Canvas

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    statusSTRING