Skip to content

RigShare 1.4.0: unload models after an idle period - #4

Merged
xiaodoudou merged 1 commit into
masterfrom
idle-auto-unload
Oct 25, 2026
Merged

xiaodoudou merged 1 commit into
masterfrom
idle-auto-unload

Conversation

@xiaodoudou

Copy link
Copy Markdown
Owner

A new admin option unloads models once the server has been idle for a while, so the VRAM is free for other programs (Ollama, vLLM...).

  • Unload models after idle (min, 0 = off) (auto_unload_minutes, off by default). Once nothing has run for that many minutes, the hub sets ComfyUI's unload_models queue flag, the same as the Unload models button. A run or a waiting prompt restarts the clock, and it unloads once per idle period.
  • Also clear the cache when unloading (auto_unload_cache) sets free_memory as well, like Free models & cache.

Tested on a live server with a 1-minute timer: after an SDXL run, ComfyUI's VRAM went from 5.7 GB to 626 MB once the minute was up. New test test_auto_unload_after_idle; the Python and JS suites pass.

New admin option (auto_unload_minutes, off by default): once nothing has run for that many minutes, the hub sets ComfyUI's unload_models queue flag, as the Unload models button does. A run or a waiting prompt restarts the clock; it unloads once per idle period. auto_unload_cache also clears the node cache (free_memory).
@xiaodoudou
xiaodoudou merged commit 6041a1d into master Oct 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant