Skip to content
,

How to Merge Models in ComfyUI: Simple, Add Difference, Block Merge and LoRA (2026)

9–13 minutes
Woman at a photo editing desk holding a tablet with a MODEL MERGE card, hook merge models in ComfyUI

You have two checkpoints you like. One nails faces, the other nails lighting. Merging them in ComfyUI takes three nodes and no extra installs, and you can test the result on the canvas before you write a single gigabyte to disk.

This guide is built from ComfyUI’s own merging code (nodes_model_merging.py) and the official ComfyUI examples. It covers simple weighted merges, “add difference” merges, block merging for SDXL and Flux, baking a LoRA into a checkpoint, extracting a LoRA from two models, and where the saved files end up.

TL;DR

  • Simple merge: two Load Checkpoint nodes → ModelMergeSimple (and CLIPMergeSimple) → KSampler. ratio 1.0 = all model1, 0.0 = all model2, 0.5 = half and half.
  • Add difference: ModelSubtract (A − B) → ModelAdd (+ C). This is how you turn any SD model into an inpaint model.
  • Block merge: ModelMergeBlocks (input/middle/out) or model-specific nodes like ModelMergeSDXL and ModelMergeFlux1 for per-block ratios.
  • Save: Checkpoint Save writes to output/checkpoints/. Move the file to models/checkpoints to load it.
  • Precision: merges are saved in inference precision (usually fp16). Launch with --force-fp32 for 32-bit merges.
  • Only merge models of the same architecture (SDXL with SDXL, Flux with Flux).

New to ComfyUI? Start with my ComfyUI guide for the basics of nodes and workflows.

The Merging Nodes at a Glance

All of these are core nodes, so there is nothing to install. Double-click the canvas and search the name, or find them under advanced → model_merging.

Node Settings What it does
ModelMergeSimple ratio 0 to 1 (default 1.0) Weighted average of two diffusion models
ModelSubtract multiplier −10 to 10 (default 1.0) (model1 − model2) × multiplier
ModelAdd none model1 + model2
ModelMergeBlocks input, middle, out ratios Different ratio per UNet section
CLIPMergeSimple / CLIPSubtract / CLIPAdd Same as the model versions The same operations on the text encoder
ModelMergeSD1, SDXL, SD3_2B, SD35_Large, Flux1, Auraflow, LTXV, WAN2_1, QwenImage, Cosmos, MochiPreview and others One ratio per block Fine-grained block merging for that architecture (under model_merging/model specific)
Checkpoint Save filename_prefix Writes model + CLIP + VAE as one .safetensors

How the ratio works, straight from the code: ModelMergeSimple clones model1 and patches in model2 with strength 1 − ratio while keeping model1 at strength ratio. So the slider is “how much of model1 to keep”.

This trips people up because it’s the opposite of some other UIs, where the slider is the share of model B.

ratio Result
1.0 (default) 100% model1 (no change)
0.7 70% model1, 30% model2
0.5 Even blend
0.0 100% model2

Merges happen in memory as patches, the same way LoRAs are applied. Nothing is written to disk until you run a save node, so you can try ten ratios in a row at no cost beyond the generation time.

Simple Weighted Merge (Step by Step)

This is the “model_merging_basic” workflow from the official examples, built by hand.

  1. Add two Load Checkpoint nodes and pick the two models. Both must be the same family (for example two SDXL checkpoints).
  2. Add ModelMergeSimple. Connect checkpoint A’s MODEL to model1 and checkpoint B’s MODEL to model2.
  3. Add CLIPMergeSimple and connect the two CLIP outputs the same way. (Skip this if you want to keep one model’s text encoder: just wire that CLIP directly.)
  4. Connect the merged MODEL to your KSampler and the merged CLIP to both CLIP Text Encode nodes.
  5. Use the VAE from either checkpoint for VAE Decode.
  6. Set ratio to 0.5, fix the seed, and queue.

Now change only the ratio (0.3, 0.5, 0.7) and compare. Keeping the seed fixed is what makes the comparison fair. See my ComfyUI seed guide if you’re not sure how.

When you like the result, add a Checkpoint Save node, connect MODEL, CLIP and VAE, and queue once more. The official examples suggest keeping the save node muted (Ctrl+M) while you test, then unmuting it for the final run.

Add Difference: Make an Inpaint Model

“Add difference” takes what makes model A different from its base B and adds that difference to another model C. The official example uses it to make an inpaint version of any SD model:

(inpaint_model − base_model) × 1.0 + other_model

In nodes:

  1. Load three checkpoints: the official inpaint model (A), the base it was trained from (B), and your favourite fine-tune of that same base (C).
  2. ModelSubtract: model1 = A, model2 = B, multiplier 1.0. In the code this is multiplier × A − multiplier × B.
  3. ModelAdd: model1 = the subtract output, model2 = C.
  4. Use C’s CLIP and VAE, test with an inpainting workflow, then save.

The ComfyUI examples page notes: “If you are familiar with the ‘Add Difference’ option in other UIs this is how to do it in ComfyUI.” The same pattern works for any “trained delta”, as long as A, B and C share a base.

The examples also show it for making a CosXL version of an SDXL fine-tune from the CosXL base and the SDXL base.

The multiplier accepts −10 to 10. Values below 1 add a weaker version of the difference; negative values push away from it. Stay near 1.0 unless you know why you’re changing it. To use the result for inpainting, see my ComfyUI inpainting guide.

Block Merging for SDXL, Flux and More

Different parts of a model do different jobs. Roughly, early blocks shape composition and later blocks shape detail and style. Block merging lets you take composition from one model and texture from another.

ModelMergeBlocks (any UNet model)

Three sliders: input, middle and out, each a ratio with the same meaning as ModelMergeSimple (1.0 = model1). The official “3 checkpoints” example chains two of these to blend three models with different ratios per section.

Model-specific block nodes

For finer control, ComfyUI ships per-architecture nodes with one slider per block. What the code exposes:

Node Blocks you can set
ModelMergeSD1 / ModelMergeSDXL time_embed, label_emb, input_blocks, middle_block, output_blocks, out
ModelMergeSD3_2B / SD35_Large embedders, each joint_block, final_layer
ModelMergeFlux1 img_in, time_in, guidance_in, vector_in, txt_in, double_blocks 0-18, single_blocks 0-37, final_layer
ModelMergeAuraflow embedders, double_layers, single_layers
ModelMergeLTXV, WAN2_1, MochiPreview, Cosmos, QwenImage and more That model’s transformer blocks

A starting recipe for SDXL: set input_blocks to 1.0 (keep model1’s composition), output_blocks to 0.3 to 0.5 (pull in model2’s detail), and middle to 0.7. Then adjust one group at a time with a fixed seed. There is no universal “best” block recipe, so treat any recipe you find online as a starting point.

Flux and video models are large. Merging two Flux checkpoints means both must fit in RAM at once, so plan for this on 32 GB systems. If you hit memory errors, see my ComfyUI out of memory fixes.

Bake a LoRA into a Checkpoint

The examples page puts it simply: “Since Loras are a patch on the model weights they can also be merged into the model.”

  1. Load Checkpoint → Load LoRA (set strength_model and strength_clip).
  2. Connect the LoRA node’s MODEL and CLIP outputs to Checkpoint Save, plus the VAE from the checkpoint.
  3. Queue. The saved checkpoint now behaves like base + LoRA at that strength.

You can stack several Load LoRA nodes before saving. Baking makes sense when you always use the same LoRA at the same strength; otherwise keep it separate so you can tune it per image. My ComfyUI LoRA guide covers strengths and stacking.

Extract a LoRA from Two Models

The reverse also works: turn the difference between a fine-tune and its base into a small LoRA file. ComfyUI’s core Extract and Save LoRA node (LoraSave in the code) does this.

  1. Load the fine-tune (A) and its base (B).
  2. ModelSubtract: model1 = A, model2 = B, multiplier 1.0.
  3. Connect the result to model_diff on Extract and Save LoRA. Optionally connect a CLIPSubtract result to text_encoder_diff.
  4. Set rank (default 8, range 1 to 4096) and lora_type (standard or full_diff).
  5. Queue. The file lands in output/loras/ with the default prefix loras/ComfyUI_extracted_lora.

Higher rank keeps more of the difference but makes a bigger file. Rank 8 to 32 is a common range for style fine-tunes; try a few and compare against the full model. Move the file to models/loras to load it.

Saving: Where Files Go and Which Node to Use

Every save node writes into the output folder, not the models folder. Default prefixes from the code:

Node Saves Default location
Checkpoint Save Model + CLIP + VAE in one file output/checkpoints/
ModelSave Diffusion model only output/diffusion_models/
CLIPSave Text encoder only output/clip/
VAESave VAE only output/vae/
Extract and Save LoRA LoRA from a model difference output/loras/

For SD1.5 and SDXL checkpoints, Checkpoint Save is the natural choice. For Flux, Wan, Qwen-Image and other models that you normally load with separate UNet, text encoder and VAE loaders, ModelSave gives you a diffusion-model-only file that goes in models/diffusion_models.

Two more details from the source and examples:

  • Saved checkpoints contain the workflow. You can drag a merged .safetensors onto the canvas to see exactly how it was made, just like a PNG.
  • Precision: models are merged and saved in the precision used for inference on your hardware, usually fp16. To merge in fp32, launch ComfyUI with --force-fp32 (and expect a file about twice the size).

To find the output folder on your install (portable, manual or Comfy Desktop), see where ComfyUI saves images. To keep merged models on another drive, see extra_model_paths.yaml.

Tips for Merges That Actually Work

  • Same family only. SDXL, Pony and Illustrious are SDXL-architecture and can be merged with each other, though results vary because their training differs a lot. SD1.5 with SDXL, or SDXL with Flux, cannot be merged.
  • Fixed seed, fixed prompt. Change one thing per test.
  • Test several prompts (a portrait, a landscape, a hand close-up) before saving. A merge can look great on one subject and fall apart on another.
  • Check the license of both source models before you share a merge. Some licenses don’t allow merges to be redistributed.
  • Keep the text encoder in mind. If prompts stop working well after a merge, try using one model’s CLIP unchanged.
  • Label your files with the ratio, for example checkpoints/juggxl_dream_0.6 as the filename_prefix.

Common Problems

Problem Cause Fix
Merge looks exactly like model1 ratio left at the default 1.0 Lower the ratio (0.5 = even blend)
Result is noise or garbage Models from different architectures Only merge models of the same family
Can’t find the saved checkpoint in Load Checkpoint It’s in output/checkpoints Move it to models/checkpoints and refresh (R)
Out of memory while merging Flux or video models Both models loaded at once More RAM/pagefile, or merge fp8 versions; see the OOM guide
Saved file is fp16 but you wanted fp32 Merges save in inference precision Launch with --force-fp32
Inpaint merge doesn’t inpaint well A, B and C don’t share the same base Use the inpaint model’s exact base as B

FAQ

How do I merge two models in ComfyUI?

Load both checkpoints, connect their MODEL outputs to ModelMergeSimple and their CLIP outputs to CLIPMergeSimple, set the ratio, and use the merged outputs in your KSampler workflow. Add Checkpoint Save to write the result to disk.

What does ratio mean in ModelMergeSimple?

It’s how much of model1 to keep. 1.0 is all model1, 0.0 is all model2, and 0.5 is an even blend.

Where does ComfyUI save merged checkpoints?

In output/checkpoints/ by default. Move the file to models/checkpoints to load it like any other checkpoint.

How do I do “add difference” in ComfyUI?

ModelSubtract (A minus B, multiplier 1.0), then ModelAdd with model C. This is the official way to make an inpaint version of a fine-tuned model.

Can I merge Flux models in ComfyUI?

Yes. ModelMergeSimple works with any two models of the same architecture, and ModelMergeFlux1 gives you per-block control over Flux’s double and single blocks. Use ModelSave to save just the diffusion model.

Can I merge a LoRA permanently into a model?

Yes. Connect Load LoRA’s MODEL and CLIP outputs to Checkpoint Save, along with the VAE. The saved checkpoint includes the LoRA at the strength you set.

Can I merge SD 1.5 and SDXL?

No. They have different architectures, so their weights don’t line up.

Why is my merged model fp16?

ComfyUI merges and saves in the precision it uses for inference, usually fp16. Launch with --force-fp32 if you need a 32-bit merge.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman at a photo editing desk holding a tablet with a MODEL MERGE card, hook merge models in ComfyUI