ControlFoley Model Unloader
Hand the VRAM back
- controlfoley_model
- after
- status
ControlFoley Model Unloader exists for one reason: this pack is heavy, and if you're sharing a GPU with anything else - another workflow, a video render, an LLM - you want to be able to release the ~16GB of weights without restarting ComfyUI. It's the cleanup node at the end of the chain: it clears the cached model from the pack's internal cache, drops the runtime's tensors explicitly, clears the video feature cache, runs a garbage collect, and empties the CUDA cache.
The one non-obvious input
The required input is controlfoley_model (the model object from the Loader), and that alone isn't enough - the output is a status string, and the node's behavior is built around the optional after input. Here's the design, and it's a real trap if you miss it:
If after isn't connected, the node returns a status that just says "Connect the after input to unload after generation" and does nothing. To make it unload, you wire something into after - the natural choice is the audio output from a Save ControlFoley Audio node, which by definition only exists once generation has finished. The semantic is: don't unload until this data has been produced. Because of ComfyUI's execution order, wiring the save node's audio into after guarantees the unload runs after the audio is written, not before.
Why go to that trouble? Unloading too early is catastrophic in this pack - a Generate node running against an unloaded model raises "This ControlFoley model was unloaded. Re-run the ControlFoley Model Loader". The unloader deliberately pops the model out of the pack's cache and gutted the runtime's tensors, so there's no silent fallback. It also bumps an internal epoch counter that the Loader's IS_CHANGED watches, which forces a clean reload on the next run rather than handing downstream nodes a stale shell. You don't have to understand any of that - just know that after is mandatory in practice.
When to use it
Not every workflow needs one. If ControlFoley is all you run and you have VRAM to spare, skip it - the loader's cache is the whole point, and unloading means paying the load cost again next run. Reach for it when you're running ControlFoley then immediately running something else memory-hungry in the same session, or when a workflow runs once and you're moving on. It's a switch, not a requirement.
Install the pack via ComfyUI Manager ("ControlFoley Official") or git clone into custom_nodes + pip install -r requirements.txt. And if your runs are memory-tight anyway, remember the pack's other lever: low_vram is a text-only T2A/TTA path, and the batch-size multipliers (4–8 instead of 40) trim peak memory during encoder feature extraction - the unloader is for after the run, those are for during it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| controlfoley_model | CONTROLFOLEY_MODEL | — | |
| afteropt | AUDIO | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |