Nodes/ComfyUI-YogurtNodes/Merge LoRA To Model (Yogurt Nodes)
ComfyUI Node

Merge LoRA To Model (Yogurt Nodes)

Applying a LoRA that's already a graph object, not a filename

By yogurt7771·Created 2 years ago·Updated 9 days ago· 1
Merge LoRA To Model (Yogurt Nodes)
  • model
  • lora
  • clip
  • model
  • clip
strength_model1.00
strength_clip1.00

Every ComfyUI user knows the LoraLoader: pick a filename, set a strength, done. Merge LoRA To Model (Yogurt Nodes) is what you use instead when the LoRA isn't a file on disk anymore - it's an object your graph built. The moment you merge two LoRAs with LoRA Add, zero out layers with LoRA Layers Operation, or load a LoRA "just to hold it" with LoRA Load Only, you have a LORA object floating in the graph with no file to point at. This node takes that object and a model, and patches the LoRA in.

Think of it as LoraLoader's cousin that eats a LORA socket instead of a dropdown. It's the node that completes the whole LoRA-manipulation mini-ecosystem in this pack: load → modify/merge → apply. Without it, all those merge and layer nodes would leave you with nothing to do with their output.

How it works

The implementation is refreshingly honest - it delegates to ComfyUI's own comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip). That's the same core function the built-in LoraLoader wraps, just fed a LoRA object you already have instead of one loaded from a filename. It patches the diffusion model (and optionally the CLIP) with the LoRA's weights scaled by the strength you set. If both strengths are zero it short-circuits and returns the inputs unchanged, which is a nice no-op touch.

The inputs that matter

  • model - the diffusion model to patch.
  • lora - the LORA object from any upstream node: LoRA Load Only, LoRA Add, LoRA Layers Operation, whatever.
  • strength_model - how hard the LoRA hits the model, -10 to 10. Negative strengths invert the effect, which is occasionally exactly what you want.
  • clip / strength_clip (optional) - if you have a CLIP and the LoRA contains text-encoder weights, wire it in and set strength_clip; leave the socket empty and it's skipped.

Two outputs: model and clip - the patched versions, ready for your sampler.

Installing it

It ships in ComfyUI-YogurtNodes. Install via ComfyUI Manager (search "ComfyUI-YogurtNodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt

Restart ComfyUI and it's under "Yogurt Nodes".

Where people get burned

The most common mistake is assuming this node loads a LoRA from a file. It doesn't - if you don't have a LORA object already, use LoRA Load Only (or a normal LoraLoader) upstream. And note the subtle difference from the built-in loader: strength here applies at merge time to the object you hand it, so if your object was already scaled or merged, this is your second strength multiplier, not your first. For a plain "load and apply" job the stock LoraLoader is still the simpler tool - this one earns its keep specifically in the modified-LoRA pipelines.

CategoryYogurtNodes/Models

Inputs (5)

NameTypeDefaultDescription
modelMODELDiffusion model to patch.
loraLORALoRA object.
strength_modelFLOAT1.00-10–10Strength for model patching.
clipoptCLIPOptional CLIP to patch.
strength_clipoptFLOAT1.00-10–10Strength for CLIP patching.

Outputs (2)

NameTypeDescription
modelMODEL
clipCLIP