IndexTTS2-卸载模型
Free your VRAM when you're done with IndexTTS2
- isOk
IndexTTS2 is a chunky model - once loaded, it squats on your VRAM until you tell it to leave. LamIndexTTS2UnloadModel is that tell: it asks the IndexTTS2 server to unload the model and tells you whether it succeeded. That's the entire job. There's nothing clever here, but if you run ComfyUI image/video models and an IndexTTS2 service on the same GPU, this is the difference between smooth generation and a wall of out-of-memory errors.
Like every node in this pack's TTS family, it doesn't touch the model directly. It's a one-call HTTP client: it asks the server at http://localhost:5000 whether the model is loaded (/is_loaded) and, if so, POSTs /unload.
Inputs and outputs
- server -
http://localhost:5000, tooltip 请勿修改 ("don't modify"). Change it only if your IndexTTS2 server is on a different host or port. - isOk (output, BOOL) -
trueif the server reported a successful unload (or the model wasn't loaded to begin with),falseotherwise.
There are no other inputs or outputs. It's not an output node, so you can tuck it anywhere in the graph and it'll just run when its turn comes.
Install
It's part of the ComfyUI_Lam pack:
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam
or via ComfyUI Manager (search ComfyUI_Lam), then the pack's install + 修改文件 scripts per the README. The node itself is trivially small; the real setup work is the IndexTTS2 service and its model (the pack's 下载模型.bat pulls IndexTeam/IndexTTS-2 from Hugging Face).
Gotchas
If the server isn't running, this node throws rather than returning false - a connection error from requests propagates up. So it's not a "cleanly report the server is down" node; it assumes the server exists. Also note it only unloads the TTS model from the server's memory; ComfyUI's own models are untouched. If you're the type to run one long TTS batch then immediately switch to image work, put this at the end of your TTS workflow and spare yourself the OOM dance. If you'd rather just check it's loaded without unloading, there's no dedicated node for that in the pack - this one is strictly the exit door.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| server | STRING | http://localhost:5000 | 请勿修改 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| isOk | BOOL | — |