VRGDG Unload Gemma/GGUF Models
The VRAM janitor for the pack's Gemma/GGUF prompt brains
- status
Here's a frustrating ComfyUI fact of life: a model stays in VRAM after you're done with it. Load a Gemma GGUF to generate prompts, and it lingers in memory while you try to render video - and then LTX OOMs because the LLM never left. VRGDG Unload Gemma Models is the pack's designated cleanup node: it forcibly unloads the cached GGUF/Gemma llama.cpp models that this pack's LLM features load, and can clear the CUDA cache on top, so you can free VRAM mid-workflow instead of restarting ComfyUI.
The VRGDG pack uses llama.cpp-based Gemma models in several places - the Video Editor's visual prompt buttons (a Gemma GGUF plus an mmproj file so the model can see the captured frame), the I2V prompt generation, the storyboard and prompt tools. All of those share the same problem: a text model that can be 7–20GB sitting on a card you need for diffusion. This node is the release valve, and in a video pipeline where the LLM and the diffusion model can't coexist, it's not optional - it's the thing that makes the "enhance → unload → render" sequence work.
The two knobs
- clear_cuda_cache (default on) - also empties PyTorch's CUDA cache after unloading, which reclaims the fragment that stays reserved even after
del. Leave it on. - clear_hf_pipeline_cache (default off) - clears non-GGUF local LLM pipeline caches too (transformers-style pipelines). The tooltip says it plainly: usually leave this off, turn it on only if you also want to nuke those other caches. It's off by default for a reason - it can invalidate state that other nodes are holding.
That's it. Two booleans, one status string output that tells you what got freed. It's an output node in spirit - you place it, run it, and it reports.
Where it belongs in a workflow
Sequence is everything. Run the LLM node to generate your prompts, wire the generated prompt onward, then fire this node before the sampler that needs the VRAM. Because it unloads, anything downstream that tries to call the Gemma model again will need to reload it - so don't put this in the middle of an LLM loop. The pattern the pack intends: prompt generation pass → unload → video render.
Install
Part of comfyui-vrgamedevgirl, installed the standard way: ComfyUI Manager → search vrgamedev, or clone and install requirements. One honest heads-up: the llama-cpp-python dependency that powers these GGUF models is the fiddliest part of this entire pack on Windows - it needs build tooling (the README walks through installing Cython and scikit-build-core first, and Python 3.12 beats 3.13 for the portable build). If the Gemma buttons in the Video Editor just sit there doing nothing, it's not this node's fault - it's the llama-cpp layer underneath not being built properly. This node only cleans up after models that actually loaded.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| clear_cuda_cache | BOOLEAN | true | — |
| clear_hf_pipeline_cache | BOOLEAN | false | Usually leave this off. Turn it on only if you also want to clear non-GGUF local LLM pipeline caches. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |