Nodes/Comfy_HunyuanImage3/Hunyuan Instruct Unload
ComfyUI Node

Hunyuan Instruct Unload

The tidy 'clean up after yourself' node for Instruct models

By EricRollei·Created 10 months ago·Updated 4 months ago· 65
Hunyuan Instruct Unload
  • trigger
  • status
enabledtrue

The Instruct models in this pack are a different animal from the base text-to-image model: the full Instruct variant runs 50 steps with a doubled CFG batch, and the Distil variant swaps that for 8 fast steps. Either way you end up with an ~45–160GB model sitting in memory, and when you're done with it, you want it gone properly. Hunyuan Instruct Unload (class HunyuanInstructUnload) is the pack's dedicated cleanup node for exactly that: it clears the cached Instruct model from both VRAM and RAM.

Why a separate unload for Instruct? Because the two model families are isolated in this pack - a base-model unload node won't necessarily touch the Instruct cache, and the README warns repeatedly against mixing base and Instruct nodes. The Instruct loader caches its model separately, and this node is the counterpart that frees it.

How it works

Single input, single toggle:

  • enabled (BOOLEAN, default True) - the whole design in one switch. True means "unload the Instruct model." False means "do nothing and pass through."

That toggle is genuinely useful, not decorative. The README's known-limitations section notes that RAM can creep up across successive Instruct loads - some references persist even after unload, and the honest fix is restarting ComfyUI when RAM climbs. But for the normal case, being able to keep this node wired into a workflow and flip it on/off by a boolean lets you control unload behavior per-run without deleting the node from your graph.

There's also an optional trigger input (any type) so you can fire the unload at the end of a generation chain, and a single status (STRING) output.

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, hard-refresh the browser, and it's under Hunyuan/Instruct. ComfyUI Manager users can search HunyuanImage instead.

Common issues & troubleshooting

The node says it unloaded but RAM stays high. This is the known limitation the README flags: Instruct load can leave references that survive a normal unload. If you're doing many successive Instruct generations and watching RSS creep up, unload will help but a ComfyUI restart is the real fix for accumulated leaks.

You wired it in but nothing happened. Check enabled - if it's False, the node is intentionally a no-op. That's the feature, not a failure.

You're switching from Instruct back to base Hunyuan and hitting errors. The two families don't mix. Use this node to clear the Instruct cache, then load the base model fresh. And if you're switching models repeatedly, remember the pack's Soft Unload only covers base models - Instruct models get a hard unload here.

CategoryHunyuan/Instruct

Inputs (2)

NameTypeDefaultDescription
enabledBOOLEANtrueToggle unload on/off. When False, node passes through without unloading. Useful for keeping the node wired in your workflow but skipping unload when you want to keep the model loaded for multiple runs.
triggeropt*

Outputs (1)

NameTypeDescription
statusSTRING