Easy SongGeneration - 释放模型
The polite way to get a 4B music model out of your VRAM
- songgen_model
- 状态
Easy SongGeneration - 释放模型 ("Release Model") is the smallest node in the pack and the one you'll appreciate most when the generation is done. SongGeneration's v2-large checkpoint is around 4B parameters, and the loaded stack - codec LLM plus diffusion decoder plus VAE - will happily sit in VRAM forever after one song. This node is the explicit "I'm done, give me my memory back" button.
How it works
You feed it the songgen_model handle from the loader node and it does the teardown: the model is dropped from the pack's in-memory cache (and the cache's owner tracking is cleaned up), references to the model and its config are nulled out, Python's garbage collector runs, and - if 清理显存缓存 (clear_cuda_cache, default on) is set - it calls torch.cuda.empty_cache() plus ComfyUI's own soft_empty_cache(). You get a status string back confirming it: "SongGeneration model released."
The node is deliberately thin. There's a handle input and one boolean, and nothing to misconfigure - the default is the right answer in almost every case.
Why the cache matters
The pack caches loaded models, which is what makes sharing one handle across several generate nodes cheap. ReleaseModel exists to undo that deliberately. The important consequence: if you release the model and then run another generate node that still points at that handle, it will error with "SongGeneration model has been released" - so don't put the release node in the middle of a workflow that still has queued generations waiting on the same handle. Put it at the end of the branch, or after you've confirmed the song is done and saved.
When to run it
- After a music workflow completes and you want to switch back to image/video work without ComfyUI deciding it needs to offload everything itself.
- Between long batches, if a later generate node loads a different model - the loader releases a previous model when you load a new one, but an explicit release is clearer and frees the cache early.
- Before running something VRAM-hungry like a big video model. The KB's audio essay makes the point that the whole audio layer is compute-cheap except the video it attaches to - this node is how you make sure the music model isn't the thing stealing that budget.
It doesn't delete anything on disk - the checkpoint stays in ComfyUI/models/SongGeneration/, so the next load is one click away (and the quantization cache survives too, in models/SongGeneration-cache). Think of it as closing a tab, not uninstalling the browser.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| songgen_model | SONGGEN_MODEL | 要释放的 SongGeneration 模型。 | |
| clear_cuda_cache | BOOLEAN | true | 释放后调用 torch.cuda.empty_cache。 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 状态 | STRING | — |