Nodes/PG Nodes/Merge LoRA
ComfyUI Node

Merge LoRA

Bake a LoRA into both paths in one step

By GizmoR13·Created 11 months ago·Updated 11 months ago· 16
Merge LoRA
  • model
  • clip
  • lora_bridge
  • model
  • clip
which_loralora_1
strength_model1.00
strength_clip1.00

PgMergeLoraBoth is the one-stop, old-school LoRA apply: it takes a LoRA from a LORA_BRIDGE slot and permanently merges it into both your MODEL and your CLIP at once, with independent strengths for each. Two inputs in, two patched outputs out, no hook machinery anywhere in the middle. If you're the "set the strength, hit queue, don't think about it" type, this is the node.

It's the destructive counterpart to the pack's hook system, and the trade-off is worth being honest about. A merge bakes the LoRA into the model and text encoder objects - fast at runtime, deterministic, zero per-step overhead - but the strength is fixed from the moment the graph executes. Want to compare 0.6 against 0.9? You're changing the widget and re-running the merge. The hooks route (PgCreateHookLoraBothSet Clip/Model Hooks) keeps the strength live and lets you keyframe it, at the cost of running the hook machinery during sampling. For one-shot generation or when you're done iterating, the merge is genuinely the better tool.

How it works

Under the hood it's one call to ComfyUI's comfy_sd.load_lora_for_models() with your model, your clip, and the bridge slot's LoRA - the exact same merge path core ComfyUI's LoraLoader uses, just handling both outputs in a single node. If both strengths are 0 it short-circuits and passes your model and clip through untouched; if one side is 0, only the other gets patched. Errors are caught and logged as [PgMergeLoraBoth] apply error, leaving the original model and clip intact - so a broken LoRA won't take your whole graph down.

Inputs

  • model and clip - from your checkpoint loader or Unified Loader.
  • lora_bridge - the bundle from a LoRA Bridge Loader. Remember: the file lives here, not in this node.
  • which_lora - the slot (lora_1lora_4, default lora_1).
  • strength_model and strength_clip - both -100 to 100 (0.01 steps). The pack's merge nodes allow a wider range than the hook nodes, which is mostly a sign that you can go weird with negatives if you want.

Outputs: model and clip, wired to your sampler and text encoder as usual.

Install

Part of PG Nodes: ComfyUI Manager → "PG Nodes" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/GizmoR13/PG-Nodes

No downloads beyond the pack itself; it reads LoRAs from your existing loras folder.

Common issues

The recurring footgun is slot confusion: which_lora defaults to lora_1, so if your file is loaded in slot 3 the node merges an empty slot and silently passes your model through (check the console for the error line - it's printed, not shown in the UI). And because the merge is destructive, don't also stack a hook for the same LoRA on the same path - you'll apply it twice. Start with strength_model and strength_clip at 1.0, dial the clip side down toward 0.6–0.8 for character work, and only go past that when you know what you're chasing.

CategoryPG/Lora

Inputs (6)

NameTypeDefaultDescription
modelMODEL
clipCLIP
lora_bridgeLORA_BRIDGE
which_loraCOMBOlora_14 options: lora_1, lora_2, lora_3, lora_4
strength_modelFLOAT1.00-100–100
strength_clipFLOAT1.00-100–100

Outputs (2)

NameTypeDescription
modelMODEL
clipCLIP