Diffusers Merge LoRA to Pipeline
Now actually apply that LoRA
- pipeline
- lora
- PIPELINE
If DiffusersLoadLoraOnly is the "load without applying" half of this pack's LoRA split, DiffusersMergeLoraToPipeline is the half that actually does something. It takes a loaded LoRA and a loaded pipeline and merges them - specifically, it hands the LoRA to the pipeline's transformer via diffusers' load_lora_adapter, so the adapter's weights take effect on the diffusion model itself.
The division of labor is the point: load once, inspect and edit freely, and only commit the edit to the pipeline when you're ready. Without this node, the layers-operation and save nodes would have nowhere to plug in.
Inputs
pipeline- aPIPELINEfrom DiffusersPipeline (or one that's been through this node already, since it passes the pipeline through).lora- theLORAfrom DiffusersLoadLoraOnly, possibly after passing through DiffusersLoraLayersOperation.strength- here's the honest gotcha: this slider is mostly decorative. Read the source and you'll see it's only checked for whether it equals zero. At 0 it returns the pipeline untouched; at any other value - 0.5, 2.0, −1 - it callsload_lora_adapterwith the file's weights as-is. It does not scale the adapter. If you want a real weight fade, do it in the layers-operation node by scaling the tensors, or feed a pre-scaled LoRA.adapter_name- the name diffusers gives this adapter inside the pipeline (default"default"). Change it if you want to stack multiple adapters and keep them addressable.
How it works
Before merging, the node walks the state dict for alpha keys, pulls them out into a separate network_alphas dict (that's the alpha that scales LoRA weights relative to rank), and passes both into pipeline.transformer.load_lora_adapter(...). Note the target: the transformer only. The text encoder stays untouched - which, given that LongCat's encoder is an 8B Qwen2.5-VL model, is probably a mercy anyway.
Output is a PIPELINE - the modified pipeline - which you wire forward to DiffusersSampling. And here's a subtle downstream detail: after generation, the sampling node calls unload_lora_weights() on the pipeline, so the adapter is cleared once it's done its job. Re-run and you'll need the merge node to fire again - which it will, since it's upstream in the graph.
Install
ComfyUI Manager → "Comfyui-DiffusersUtils", or:
cd ComfyUI/custom_nodes
git clone https://github.com/lrzjason/Comfyui-DiffusersUtils
Restart ComfyUI. No extra pip deps for the LoRA path.
Common issues
- "Applied but no effect" - strength is 0 (the bypass branch), or the merge node isn't actually in the path between load and sample. Trace the wires: pipeline → merge → sampling.
- Zeroing then merging then sampling - a LoRA with zeroed layers still loads fine; the zeroed weights just contribute nothing, which is usually exactly what you wanted.
- The README refers to a "MergeLoraToModel" - that's a typo; this node is the one it means.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| pipeline | PIPELINE | — | |
| lora | LORA | The loaded LoRA to apply. | |
| strength | FLOAT | 1.00-10–10 | How strongly to modify the diffusion model. This value can be negative. |
| adapter_name | STRING | default | The name of the adapter to use. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PIPELINE | PIPELINE | The modified pipeline. |