EBU LMStudio Unload All
Free your VRAM before the diffusion model needs it
- export_string
This node does exactly one thing: it tells LM Studio to unload every model it currently has loaded. No target, no fuzzy search, no "unload just this one" - everything goes. That bluntness is the point. If you're using an LLM to write or expand your prompt (via EbuLMStudioMakeRequest or EbuLMStudioBrainstormer) and then handing off to a diffusion model in the same graph, you've got two things competing for the same GPU's VRAM, and the LLM is the one you're done with once your prompt is written. This is the node that says "get out of the way now."
The trick that makes it actually work
Here's the part that trips people up: this node has a STRING input and a STRING output that just... pass the value through unchanged. That's not a bug, it's the whole mechanism. ComfyUI's graph is a dependency DAG - every operation is a node, and wires between them define the data flow, which is also what determines execution order. A node that isn't wired into the path leading to something you actually generate doesn't run; it just sits there dangling. So to guarantee the unload actually fires before your sampler runs, you thread a string through it - your prompt text, the output of your LLM node, whatever's convenient - and let export_string carry that same value onward into your CLIPTextEncode or wherever it was headed anyway. The unload becomes a mandatory stop on the way, not an optional side node you have to hope executes in the right order.
If your workflow uses ComfyUI's advanced Custom Sampler setup instead (common on Flux workflows, which route through a GUIDER socket rather than a plain KSampler), this plain string version isn't the one you want - see EbuLMStudioUnloadGuider for that variant.
The two fields
input_string is whatever text you're routing through - pick something already flowing through your graph rather than inventing a dummy value, so you're not adding an extra disconnected wire. seed is there for a less obvious reason: without something changing between runs, ComfyUI's caching can decide nothing's different and skip re-executing the node entirely, which defeats the purpose of an unload you actually wanted to happen. Change the seed (or leave it randomizing) if you want this to fire reliably every single run.
Installing it
Same as every node in this pack: ComfyUI Manager, search "EBU LMStudio" and install, or manually cd ComfyUI/custom_nodes && git clone https://github.com/burnsbert/ComfyUI-EBU-LMStudio and restart. This particular node needs nothing beyond LM Studio itself being installed and its local server/CLI reachable - there's no model file or extra dependency tied to it specifically.
Where people get burned
The most common mistake is exactly the thing this node is designed around: dropping it into the graph but not actually wiring input_string and export_string into the live data path. If it's just floating there disconnected, ComfyUI has no reason to execute it, and you'll see your image generation still choke on VRAM even though the unload node is sitting right there looking like it should have helped. Trace the wire - export_string needs to lead somewhere that actually runs.
Second: this unloads LLMs from LM Studio specifically. It does nothing to your ComfyUI-side diffusion checkpoint, LoRAs, or VAE - if you're still running out of memory after this fires, the contention is coming from somewhere else in your graph, not from LM Studio still holding a model. And if VRAM still isn't freed after the node runs, check that LM Studio's own memory management isn't holding something cached - that's LM Studio-side behavior this node can't override, it can only ask.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input_string | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| export_string | STRING | — |