Nodes/Qwen Layers Diffuser Pipeline/Eric Qwen Unload Model
ComfyUI Node

Eric Qwen Unload Model

The polite way to get your 15GB of VRAM back after a Qwen decompose

By EricRollei·Created 8 months ago·Updated 8 months ago· 6
Eric Qwen Unload Model
  • trigger
  • status

If you've ever left a workflow running and watched ComfyUI crawl because the Qwen-Image-Layered pipeline is still sitting in VRAM, you know why this node exists. EricQwenUnloadModel is a one-job node: it tells the pack to drop the cached pipeline and hand the GPU memory back.

How it works

The Decompose node keeps the loaded pipeline in a module-level cache so repeat runs are fast - that's the keep_model_loaded behavior. This node reaches into that same cache, deletes the pipeline, runs gc.collect() and torch.cuda.empty_cache(), and reports what happened. Under the hood it's clear_qwen_pipeline(): the same function the Decompose node calls internally when you ask it to switch models or free memory after each run.

It's an output node, so it runs at the end of the graph. Its one input, trigger, is a wildcard - wire any upstream output into it and the unload happens after that node finishes. So the pattern is:

[Decompose (keep_model_loaded=True)] → [Layer Save] → [Unload Model]

The only output is status, a STRING that tells you whether the pipeline was actually loaded and unloaded or there was nothing to free.

When you actually need it

Honestly, only if you keep the model resident. Two situations:

  • You're doing batch decomposes and want the second run fast, but you'll switch to a different workflow afterward.
  • You're on a 16GB card, which is borderline for this 20B model, and every gigabyte matters for what comes next.

If you set keep_model_loaded to false on the Decompose node, the pipeline unloads after every pass and you can skip this node entirely. The tradeoff is a full model reload each time you hit Run, which for a 20B checkpoint is a real wait. Batch work benefits from keeping it loaded and unloading once at the end - that's the intended workflow.

One honest caveat

This node only frees this pack's Qwen pipeline. It won't unload your checkpoint, your other custom nodes' models, or anything else ComfyUI has cached. If you're fighting for VRAM across an entire workflow, you want ComfyUI's built-in free-memory tools too, not just this.

Installation is the same as the rest of the pack - ComfyUI Manager (search "Eric Qwen") or a git clone of the repo into custom_nodes, then restart. No model download needed for this node on its own.

CategoryEric Qwen Layer

Inputs (1)

NameTypeDefaultDescription
triggeropt*Connect any output here to trigger unload after that node completes

Outputs (1)

NameTypeDescription
statusSTRING