HunyuanWorld Unload Models
The HunyuanWorld Unload Models node
- status
This is the unglamorous cleanup node every pack eventually needs, and this pack needs it more than most. The other four nodes in krmahil/comfyui-hunyuan-world keep their FLUX pipelines cached in a shared in-memory model cache so your second call is fast. The side effect: after you've generated a panorama or two, your GPU is quietly holding ~23 GB FLUX.1-dev, or ~23 GB FLUX.1-Fill-dev, or both if you ran text and image routes in the same session. HYWorldUnloadModels is the eject button - it wipes that cache and asks CUDA for its memory back.
How it works
It's deliberately boring. The node clears the pack's shared _MODEL_CACHE dict and calls torch.cuda.empty_cache(). That's it - no model management, no offloading heuristics. It reports how many cached pipelines it dropped. One detail worth knowing: there's a confirm boolean input (default true), and it's not decorative. Set it to false and the node does nothing and returns "Skipped." If you're the type to keep a disabled confirmation node lying around a workflow, don't.
Inputs and outputs that matter
confirm- BOOLEAN, defaulttrue. Leave it on. The node won't unload anything if this is false.
Output: status - a STRING telling you how many cached models were unloaded. It's mostly a paper trail; you'll feel the actual result the next time you load a checkpoint.
Installing it
Same pack as everything else: ComfyUI Manager → HunyuanWorld 3D World Generation, or
cd ComfyUI/custom_nodes
git clone https://github.com/krmahil/comfyui-hunyuan-world.git
pip install -r comfyui-hunyuan-world/requirements.txt
Unlike the generation nodes it needs no models of its own - the heavy install (HunyuanWorld-1.0, Real-ESRGAN, ZIM, the gated FLUX downloads) is only required for the pipelines it unloads.
When you'd actually use it
Two spots make sense. Tacked onto the end of a HunyuanWorld workflow so the card is clean when the next model loads - this pack's runs are long, so people often batch several in a row, and each one leaving ~20+ GB parked is how you end up OOM-ing a totally unrelated workflow. Or run it manually from the node menu when you're done experimenting and want your 4090 back without restarting ComfyUI.
One honest caveat: it only frees this pack's cached models. It won't unload your SD checkpoint, your LoRAs, or anything else the other custom nodes cached. If your VRAM is full for other reasons, this node is not the emergency brake you're looking for. For the HunyuanWorld models specifically, it does exactly what it says.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| confirm | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |