Hunyuan 3 Force Unload (Nuclear)
The last resort that actually frees stuck VRAM
- trigger
- cleared
- memory_report
- unload_signal
Let's be honest about what this node is for: the other 11 months of the year you don't need it. Hunyuan 3 Force Unload (Nuclear) (class HunyuanImage3ForceUnload) is the emergency crew for the days when Hunyuan 3 has eaten your 80GB+ of VRAM, ComfyUI "forgot" about an allocation, and even a normal unload won't budge it. The "Nuclear" is in the name because the author means it - this node can clear every cached model in ComfyUI, not just Hunyuan.
The scenario that makes it genuinely worth having wired in: cross-tab VRAM pollution. If you keep workflows open in multiple browser tabs, models loaded from other tabs stay in VRAM but ComfyUI's cache no longer tracks them. Your next run then fails with a fake OOM. That's exactly the case the README calls out, and it's the one where Nuclear earns its place in a permanent workflow.
How it works
It's a stack of memory-blasters, each independently toggleable:
clear_all_models(default True) - clears the Hunyuan model cache.aggressive_gc(default True) - three passes of garbage collection.reset_cuda_allocator(default True) - resets the CUDA memory allocator; the thing to reach for after an OOM.clear_comfy_cache(default True) - clears ComfyUI's internal model cache. The tooltip warns this affects all models, not just Hunyuan. Flux and SAM2 included. This is why the node is nuclear.nuke_orphaned_tensors(default False) - hunts down stray Hunyuan CUDA tensors. The author scopes it to Hunyuan, so it's safe for downstream models - use it when VRAM is stuck after an OOM.nuke_ram_tensors(default False) - same idea for leaked Hunyuan tensors in system RAM, for when your RAM fills with weights that should've been freed.
The one setting to care about
first_run_only (default False) is the clever bit. Set it True and the node does its full cleanup on the first execution of a workflow run, then auto-skips every subsequent run. That's the pattern for a multi-run session: the first run wipes the pollution from other tabs, and your successive runs keep Hunyuan loaded and fast instead of re-nuking it. For the "clean once, then keep rolling" workflow it's the difference between Nuclear being a one-time fix and a recurring foot-gun.
There's also an optional trigger input (any type) and three outputs: cleared (BOOLEAN), memory_report (STRING), and unload_signal (wildcard). The signal output is useful - wire it into a loader's unload_signal input (the INT8 Budget loader has one) to sequence a clean load after the purge instead of racing it.
How to install it
It's part of the Comfy_HunyuanImage3 pack:
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Comfy_HunyuanImage3
cd Comfy_HunyuanImage3
pip install -r requirements.txt
Restart ComfyUI and hard-refresh the browser. Or install via ComfyUI Manager (search HunyuanImage).
Common issues & troubleshooting
Don't use this for routine cleanup. It clears everything - your next run will pay a full reload on every model, and with Hunyuan that's a multi-minute cold start. For day-to-day, the README's utility-node matrix has the right mapping: Soft Unload for fast model switching, plain Unload for standard cleanup, Nuclear only when VRAM is genuinely stuck or polluted from another tab.
If you're running this after an OOM and VRAM still looks full, enable nuke_orphaned_tensors - that's the setting that reaches allocations the normal cache-clearing path can't see. And on multi-GPU boxes, the README suggests pairing this with the GPU Info node to confirm what torch.cuda actually sees before you start blasting.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| first_run_only | BOOLEAN | false | Only run on FIRST execution, then auto-skip. Perfect for cleaning up cross-tab pollution while keeping Hunyuan loaded for successive runs. |
| clear_all_models | BOOLEAN | true | Clear Hunyuan model cache |
| aggressive_gc | BOOLEAN | true | Run aggressive garbage collection (3 passes) |
| reset_cuda_allocator | BOOLEAN | true | Reset CUDA memory allocator (may help after OOM) |
| clear_comfy_cache | BOOLEAN | true | Clear ComfyUI's internal model cache (affects all models!) |
| nuke_orphaned_tensors | BOOLEAN | false | Hunt and destroy orphaned Hunyuan CUDA tensors. Safe for downstream models (scoped to Hunyuan only). Use after OOM when VRAM is stuck. |
| nuke_ram_tensors | BOOLEAN | false | Hunt and destroy orphaned Hunyuan CPU tensors in RAM. Safe for downstream models (scoped to Hunyuan only). Use when system RAM is full of leaked model weights. |
| triggeropt | * | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| cleared | BOOLEAN | — |
| memory_report | STRING | — |
| unload_signal | * | — |