Nodes/DiffSynth-ComfyUI/DiffSynth: LoRA Clear
ComfyUI Node

DiffSynth: LoRA Clear

LoRA Clear — the one-input node that saves you a reload

By modelscope·Created about a month ago·Updated a day ago· 8
DiffSynth: LoRA Clear
  • pipe
  • pipe

This node has one input, one output, and no settings, and it's still the node that stops you from restarting ComfyUI.

pipe in, pipe out. That's it. Behind the scenes it calls clear_lora() on the DiffSynth pipeline and hands you the same object back, with every adapter stripped off.

Why it matters more here than elsewhere

In a normal ComfyUI graph, LoRAs belong to the model object that a loader produced, and swapping them means re-running the loader. Here, LoRA Load mutates the live pipeline in a specific order, and that order is sticky. If you loaded a 4-step Lightning adapter on the last run and now you want the plain model, you don't have a clean pipeline anymore - you have one with a distilled adapter welded to the transformer.

Reloading the whole pipeline is the expensive fix: for a 20B transformer plus text encoder plus VAE, that's a minute of disk I/O at best, and on a 33B model considerably worse. Clearing is the cheap fix, and it's why every LoRA chain in the pack's templates starts with this node:

Loader → LoRA Clear → LoRA Load → Inference

On a first run the clear is a no-op. It's there so the next run is correct.

How it fits the pack's LoRA chain

LoRA Load returns a pipe and expects one, so you chain nodes rather than feeding a list. That means the pipeline carries state forward through the graph in a way most ComfyUI users aren't used to - the model isn't a value that flows, it's an object that gets edited as the graph executes. Clear is the reset button for that object.

Two consequences worth internalizing:

  • Clearing is all-or-nothing. There's no "unload just this one." If you have three adapters stacked and want two, you clear and reload the two.
  • Order in the graph is evaluation order. Clear after Load in the chain and you've wiped the LoRA you just attached. The README is explicit about the order for a reason.

Install

The usual pack install - ComfyUI Manager, search DiffSynth-ComfyUI, or:

pip install git+https://github.com/modelscope/DiffSynth-Studio.git
cd ComfyUI/custom_nodes && git clone https://github.com/modelscope/DiffSynth-ComfyUI.git

Then restart ComfyUI. This node has no dependencies beyond the pack itself and downloads nothing.

Where people get burned

Wiring it in the wrong place. If the pipe comes from the Loader and you clear it before loading, fine. If the chain is Loader → LoRA Load → LoRA Clear → Inference, your LoRA is gone and your output looks inexplicably like a base-model render. Silent, and easy to spend twenty minutes on.

Assuming it resets more than LoRAs. It clears adapters. It doesn't reload weights, release VRAM, or undo a quantization scheme - if you changed a ModelConfig's quant_config, the loader re-runs regardless.

Thinking you can skip it because "the graph is fresh". Every template ships it, and the moment you start iterating on strength values and adapter combinations you'll be glad the reset is already in the chain.

CategoryDiffSynth/LoRA

Inputs (1)

NameTypeDefaultDescription
pipeDIFFSYNTH_PIPE—

Outputs (1)

NameTypeDescription
pipeDIFFSYNTH_PIPE—