Nodes/Comfy DV Nodes/LLM Unload Model
ComfyUI Node

LLM Unload Model

Evict the model from VRAM so your image pipeline gets it back

By darth-veitcher·Created 2 years ago·Updated about a month ago· 2
LLM Unload Model
  • client
  • model_name
  • passthrough
model
passthrough

LLM Unload Model is the "put it back" half of comfydv's manual VRAM management. If LLM Load Model pins a model into memory so it's ready the moment Chat Completion runs, this node evicts it once the chat is done - freeing that VRAM for the diffusion model, the video model, or whatever your workflow does next. On a single GPU you're juggling, this is the node that stops a chat step from silently crowding out the actual image generation.

How it works

Two inputs, both plain strings: client (the LLM_CLIENT socket) and model (the name to unload - wired in, not typed, in practice). Run it and it tells the server to evict that model. It returns model_name (echoed back) and passthrough.

The passthrough input is where the ordering magic lives. ComfyUI's documentation is full of "wire X into Y so the queue runs them in order" tricks, and this is a clean version: wire Chat Completion's response output into passthrough. Because Unload needs that value, ComfyUI can't run Unload before Chat finishes - data dependency guarantees the sequence. And since passthrough is returned unchanged, the rest of your workflow can still consume the chat response even though the node in the middle evicted the model.

So the full chain, from the README:

  1. LLM Load Model's model_nameChat Completion's model - Load runs first.
  2. Chat Completion's model_nameLLM Unload Model's model - Unload runs after the chat.
  3. (Optional) Chat Completion's responseLLM Unload Model's passthrough - and the response keeps flowing downstream.

When you actually need it

If your model server has its own memory management (it does), why bother? Because "idle for a while, then evicted" isn't the same as "evicted immediately after this one call, before the next node needs the GPU." In a long queue you want the eviction to happen now, not whenever the server gets around to it. On a memory-constrained setup that timing is the whole difference between a smooth run and an out-of-memory crash halfway through.

Honestly - if you've got a 24GB card and a small model, skip the whole load/unload rigmarole. The server handles it. This pair is for the setups where every GB counts, and it's exactly there that it earns its keep.

Install

Via ComfyUI Manager (search "comfydv"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/darth-veitcher/comfydv.git

restart, and run Ollama or llama-server as your backend. One rename gotcha: this was OllamaUnloadModel before comfydv made its LLM nodes backend-generic - old saved workflows may show it as a missing node; delete and re-add, behavior is unchanged.

Categorydv/ollama

Inputs (3)

NameTypeDefaultDescription
clientLLM_CLIENT
modelSTRING
passthroughoptSTRING

Outputs (2)

NameTypeDescription
model_nameSTRING
passthroughSTRING