Nodes/EBU LMStudio LLM Integration/EBU LMStudio Unload (Guider)
ComfyUI Node

EBU LMStudio Unload (Guider)

The VRAM-freeing unload node for Flux-style sampling

By burnsbert·Created 2 years ago·Updated 6 months ago· 51
EBU LMStudio Unload (Guider)
  • guider
  • guider
seed0

Same job as EbuLMStudioUnload - dump every model currently loaded in LM Studio, no exceptions, no target - but built for a different wire. Where the plain Unload node passes a STRING through unchanged so it can slot into an ordinary CLIPTextEncode-style graph, this one passes a GUIDER through instead, which is the socket type used by ComfyUI's advanced Custom Sampler setup - BasicGuider or CFGGuider feeding into SamplerCustomAdvanced, rather than a plain KSampler. The README calls this one out specifically as "great for Flux," and that's not a random endorsement: Flux is guidance-distilled (it has no native negative prompt because the CFG mechanism is baked into the weights), and Comfy Org's own official Flux template is built around exactly that guider-based sampling path rather than the classic KSampler. If you're running that template, or anything modeled on it, this is the unload node that actually fits the wire you've got, and EbuLMStudioUnload's string version simply has nowhere to plug in.

Why route an unload through a sampling socket at all

It comes back to the same fact that governs every utility node in this pack: ComfyUI executes nodes based on the data-dependency graph, not their visual position on the canvas. A node that isn't wired into the path leading to your final output just doesn't run. So dropping an unload node into the graph unconnected accomplishes nothing - you have to make it a mandatory stop between two nodes that were already going to be connected anyway. This node does that on the guider line specifically: it takes the guider your BasicGuider/CFGGuider produced, does nothing to its actual contents, and hands the exact same guider object on to SamplerCustomAdvanced. The unload happens as a side effect of that pass-through, guaranteed to fire before sampling starts, because sampling can't start until this node has finished producing its output.

The two fields

guider is required and has no default - it has to be fed by an actual guider-producing node upstream (BasicGuider or CFGGuider in a standard Flux graph); this node doesn't create one, it only intercepts one already in flight. seed does the same job it does on every other node in this pack: without it changing between runs, ComfyUI's caching has nothing telling it to re-execute the node, so the unload could silently get skipped on a repeat run with otherwise-identical inputs.

There's no separate model-targeting field here, same as the plain Unload node - this clears everything LM Studio has loaded, unconditionally.

Installing it

Identical to the rest of the pack: ComfyUI Manager, search "EBU LMStudio," or cd ComfyUI/custom_nodes && git clone https://github.com/burnsbert/ComfyUI-EBU-LMStudio then restart ComfyUI. LM Studio needs to be installed and running separately with Developer Mode on and its CLI (lms) working - verify with lms ls --detailed. Nothing extra is required for this specific node beyond that shared baseline.

Where people get burned

The most common mistake is picking the wrong Unload variant for the graph you're actually running - if you drop this one into a plain KSampler workflow, there's no GUIDER socket for it to connect to at all, and if you drop the plain EbuLMStudioUnload into a Flux-style guider graph, it has nowhere natural to sit on that wire either. Match the node to the sampling path: guider-based advanced sampling gets this one, everything else gets the string version. Beyond that, the same caveat applies as its sibling node: this frees LM Studio's VRAM specifically, not anything ComfyUI itself is holding, so if you're still hitting out-of-memory errors after this fires, look at your diffusion model, LoRAs, or VAE rather than assuming the LLM is still the culprit.

CategoryLMStudio

Inputs (2)

NameTypeDefaultDescription
guiderGUIDER
seedINT00–18446744073709550000

Outputs (1)

NameTypeDescription
guiderGUIDER