emergency_cleanup
Frees GPU memory by unloading ComfyUI models, with an option to restart ComfyUI when memory remains constrained or CUDA out-of-memory errors block image generation.
Instructions
Recover GPU memory by unloading ComfyUI's models.
ComfyUI is a separate process and holds the models, so torch.cuda in THIS process can never free them. POST /free on ComfyUI is the only real lever; nvidia-smi measures the result.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "emergency_cleanup"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| restart_comfyui | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||