Ollama Unload Model
The Ollama Unload Model node
- client
- dependencies
- client
- result
- dependencies
You've got one GPU, and it has to do two jobs: hold an Ollama model resident for your LLM steps, then hold a diffusion checkpoint for the image generation. Those two don't love sharing. Ollama Unload Model is the node that kicks a model out of Ollama's memory when you're done with it, so the VRAM you need for the sampler is actually there.
The name undersells what it does. It doesn't shut down Ollama and it doesn't delete anything - it tells Ollama to drop the model from memory. That's it, and that's exactly what you want when your workflow goes LLM-crafts-prompt → image-gen: run the chat bits, unload, and let the checkpoint take over without an OOM or a Windows hard-crash in the middle of a batch.
How it works
Under the hood the node hits Ollama's /api/generate endpoint with keep_alive: 0, which is Ollama's documented "unload this now" signal. There's no keep_alive input on this node to fiddle with - it just sends zero, which is the whole point. You wire it in after your text generation, and the response comes back as a JSON string you can peek at in the log console.
The inputs and outputs that matter
- client - the
OLLAMA_CLIENTconnection from an Ollama Client or Model Selector node. If it has an endpoint, the node knows where to send the unload request. - model - the model name string, normally fed by the Model Selector's
modeloutput. - dependencies (optional) - a wildcard passthrough. Handy for forcing execution order when you want the unload to happen after a specific node finishes.
Outputs are client (the same connection, passed through so you can keep chaining), result (the JSON response from Ollama), and dependencies (passed through untouched). If you're not chaining anything after, the client passthrough is still worth grabbing - it keeps your graph tidy.
Installing it
The pack is ComfyUI Ollama Model Manager by darth-veitcher. Easiest path:
- In ComfyUI Manager, search "Ollama Manager" and click Install, then restart ComfyUI.
- Or manually:
cd ComfyUI/custom_nodes && git clone https://github.com/darth-veitcher/comfyui-ollama-model-manager, then runpython install.pyinside it (it auto-detects uv, falls back to pip).
It needs Python 3.12+ and three pip packages - httpx, loguru, rich - which install.py (and even the node's import hook) installs for you. The pack downloads no models itself; the models live in Ollama. It needs Ollama running, reachable at http://localhost:11434 by default.
Where people get burned
The big one: this node only helps if you actually have a memory problem worth solving. Ollama already unloads idle models eventually, but the pack's own Load Model node defaults to keep_alive: -1 (resident forever), so without an explicit unload a model will happily sit in VRAM all session. That's the case this node exists for. Second gotcha: unload is best-effort over the network - if Ollama is mid-request or the endpoint is unreachable, you'll see the error in the colored log output rather than the node failing loudly. And remember the unload only frees what Ollama held; it doesn't touch your ComfyUI checkpoint or VAE, which are managed separately by their own loaders.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| client | OLLAMA_CLIENT | — | |
| model | STRING | — | |
| dependenciesopt | * | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| client | OLLAMA_CLIENT | — |
| result | STRING | — |
| dependencies | * | — |