Unload LLM Model (integrated)
Freeing your GPU after the LLM finishes
- trigger
- trigger
- released_count
MiniMaxLLMUnload doesn't generate anything. It's the cleanup node: after the local LLM has written your song's caption and lyrics, this releases the model and its session state so the VRAM is free for the stages that come next - the actual MiniMax Music 3 generation and the FLUX cover.
Understated as that sounds, it's load-bearing in this pack. A quantized GGUF like the example Qwen3.8-27B shares your card with a music-diffusion model that is about to want a lot of that same memory. The author clearly learned this the hard way: the 2.0.1 changelog is a whole bugfix about repeated runs hanging and overflowing the GPU because the previous run's staging pages and cached models weren't released before the LLM reloaded, spilling into system RAM and leaving a broken CUDA context behind. The node now frees explicitly before every LLM load and after it runs. If you've hit a cudaErrorStreamCaptureInvalidated after running this workflow twice, that fix is why updating the pack matters.
Inputs
trigger(*) - any value, and it's how you place the node in the graph. In the example workflow the LLM Chat node'stextoutput feeds it, so unloading happens strictly after the LLM has finished and before music generation starts.unload_now- release the loaded LLM model(s) and session state. On by default.unload_flashsr- additionally release cached FlashSR model instances. Off by default, because the audio stage normally runs later in the chain - you only enable this if the FlashSR audio step has already finished and you want its cached runners gone too.
Outputs
trigger- passed straight through, so you can chain the node into the next stage.released_count- how many cached model instances were actually freed. A quick sanity check that the unload did anything.
Installing
It ships in the same pack as the rest of the toolkit:
cd ComfyUI/custom_nodes
git clone https://github.com/jplenio/ComfyUI-MiniMax-Music-Production-Toolkit.git
cd ComfyUI-MiniMax-Music-Production-Toolkit
python -m pip install -r requirements.txt
Restart ComfyUI and hard-refresh the browser. This node itself needs nothing extra - the memory it frees was allocated by MiniMaxLLMChat, which is the node that requires the separate llama-cpp-python install.
One mental model worth keeping: ComfyUI only keeps the most recently used LLM resident, and this node forces that teardown plus the allocator cleanup (gc.collect(), torch.cuda.empty_cache()). If your runs are fine on a big card, you can leave the unload node out - the workflow survives without it. On a 8–12 GB card doing the whole production chain, you'll want it in, wired from the chat output, doing its one boring job so the fun stages don't OOM.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | * | Any value; connect the LLM chat text output so this node runs after the LLM finished and frees its memory before music generation. | |
| unload_now | BOOLEAN | true | Release the loaded LLM model(s) and session state when enabled. |
| unload_flashsr | BOOLEAN | false | Also release cached FlashSR model instances (only used when the audio stage already finished). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| trigger | * | — |
| released_count | INT | — |