Ollama Stop
The Node That Kicks Ollama Out of Your VRAM
- input
- output
You know the drill: your workflow calls an Ollama VLM to caption an image or rewrite a prompt, the LLM answers, and then the next KSampler pass runs at half speed - or dies with an OOM - because a 4B vision model is still parked in your VRAM. Ollama keeps models resident after a call (there's a default keep-alive), and on a single GPU that's a real problem when diffusion wants the same memory a minute later.
Ollama Stop is a two-second fix for exactly that. It's a passthrough node that runs ollama stop <model> on your machine right in the middle of your workflow, then hands your data along untouched. No API call, no API key, no server, no dependencies. It's the smallest honest node I've seen: one file, ~40 lines, Apache-2.0.
What it actually does
Peek at the source and there's no mystery left. On execute it runs:
subprocess.run(["ollama", "stop", model_name], check=False, capture_output=True)
That's the whole trick. ollama stop unloads the model from RAM/VRAM but leaves the Ollama daemon itself running, so your next model load stays fast. It's not ollama rm - nothing gets deleted, the model files stay on disk. You're just telling the server "I'm done with this one."
Note the "on your machine" part. This runs wherever ComfyUI runs - if your ComfyUI is headless on a box with Ollama in Docker, make sure the ollama CLI on that machine points at the same server (OLLAMA_HOST), or you'll be stopping the wrong instance.
The two inputs that matter
- model_name - a plain string, and the README's single most important warning: it must match exactly what
ollama listshows, namespace, tag and all. Notqwen3-vl-abliterated, notqwen3-vl-abliterated:4b-instruct, buthuihui_ai/qwen3-vl-abliterated:4b-instruct. Copy it fromollama list, don't type it from memory. - input - required, accepts any type. It's a passthrough, so it exists so you can hang the node in a real workflow. Wire whatever you're carrying (your caption string, your image, your whatever) in and it comes out the other side unchanged.
The one output is output, same type as your input. There's no success signal, which brings us to the gotchas.
Where people get burned
The node swallows every error. check=False plus an exception handler that does pass means that if ollama isn't installed, isn't on your PATH, or the model name is wrong, nothing visibly happens - your workflow just continues like nothing went wrong. So:
- Verify it actually worked with
ollama psin a terminal - if the model's gone from the list, you're good. - Test the command by hand first:
ollama stop huihui_ai/qwen3-vl-abliterated:4b-instruct. If that works in your shell, the node will work too. - The
inputport is required, so a brand-new node with nothing wired in will sit there complaining. That's normal - this node earns its place chained between the LLM step and the sampling step.
Install
Via ComfyUI Manager: search ComfyUI-ollama-stop and hit install. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/bhhtr12/ComfyUI-ollama-stop
Then restart ComfyUI. There are zero Python dependencies and nothing to download - the pack ships no requirements at all, just stdlib subprocess. The only real requirement is that the ollama CLI is installed and on PATH on the machine running ComfyUI.
One last thing: this is a node that shells out to your system, so it earns a quick audit before you trust it. Given what happened with the LLMVISION malware back in 2024, that's not paranoia - but this one is tiny enough to read in a minute, and what it does is exactly what it says.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | STRING | — | |
| input | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |