CWB Merge Checkpoints (3 Models)
Three checkpoints into one, where the blend adapts per layer
- cwb_config
- output_filename
- documentation
- cwb_report
The three-input version of the CWB checkpoint merger, and the place where Consensus-Weighted Blending actually gets to show off. With two models, CWB is really doing clever adaptive interpolation. With three, it's doing what it was designed for: each contributor votes on a consensus, and a layer where all three agree - or where one is an outlier - gets handled differently from a layer where they're split.
How it works
Model A is still the anchor: it supplies output metadata, anchors tensor names and shapes, and is the preservation reference when tensors go missing. Models B and C are equal-prior contributors. For each tensor, CWB computes an element-wise consensus, measures each of the three models' cosine similarity to it, and weights contributions by those similarities. That's where the third input changes the character of the merge - with three contributors, the median consensus becomes meaningful and genuinely more robust than the mean, because a single outlier can't drag a mean around. The robust_medn preset exists for exactly this situation.
Everything else behaves like the two-input version: output keys are the union of all inputs, tensors only present in a secondary input are copied or merged from the sources available, and mismatch_mode decides between preserving the anchor (skip), inserting zeros (zeros), or aborting (error) when tensors are missing or shape-incompatible.
Inputs that matter
- execution_mode -
MERGEwrites the file;DOCUMENTATION ONLYreturns the CWB reference and opens nothing. - model_a / model_b / model_c - your three checkpoints. Order matters only for A, which anchors metadata and naming.
- cwb_preset (default
balanced_mean) - with three inputs, giverobust_medna look first. The name suffixes tell you what's inside:_medn= median consensus,_rn= norm rescaling,_dsc= dynamic similarity contrast,_softcb= soft comfort bandpass. - output_filename (default
cwb_merged_3_checkpoint) - written tomodels/checkpointswithout extension. - save_dtype / override_dtype - dtype for generated tensors; fp32 inputs stay fp32 unless you force it.
- exclude_patterns / discard_patterns / glob_patterns - regex (or glob) lists; excludes preserve matching layers from the anchor, discards omit them.
- lazy_load (default on) - UEL streaming, leave on so three multi-GB checkpoints don't stack in RAM.
- force_clear_cache (default on) - flush caches per layer; memory-safe but slower. Flip off if you've got headroom and want speed.
- process_device - CUDA with per-layer CPU retry on OOM, or CPU.
Outputs
output_filename (the written file), documentation (the CWB reference), and cwb_report (per-layer detail of what happened). Load the result with a normal CheckpointLoader to test it.
The realistic use case
Three-model merges are how a lot of checkpoints actually get made - take a base, a style specialist, and a character model, and CWB decides per layer which voice should dominate rather than you guessing a ratio. It's the same pack family as CheckpointModelAnalysis, so run that on pairs first if you're unsure what you're working with.
Install
From Model Utility Toolkit (silveroxides/ComfyUI-ModelUtils), installed once for the whole pack. ComfyUI Manager → search "Model Utility Toolkit", or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-ModelUtils
Restart ComfyUI. Real dependency: unifiedefficientloader (UEL). Keep ComfyUI updated - the pack uses the newer extension API. The CWB nodes are marked experimental by the author, so expect the occasional edge case on oddball checkpoints.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| execution_mode | COMBO | MERGE writes a new safetensors file. DOCUMENTATION ONLY returns the CWB reference without loading or merging inputs. | |
| model_a | COMBO | Primary contributor and preservation anchor. Supplies output metadata and anchors shared tensor names and shapes. | |
| model_b | COMBO | Second equal-prior contributor. CWB derives its effective per-vector influence from consensus similarity. | |
| model_c | COMBO | Third equal-prior contributor. CWB derives its effective per-vector influence from consensus similarity. | |
| cwb_preset | COMBO | balanced_mean | Use-case preset. Name suffixes expose alignment, consensus, norm rescaling, DSC, soft comfort bandpass, and prefix preservation. A connected CWB Config overrides it completely. |
| mismatch_mode | COMBO | skip | For missing or incompatible anchored inputs: skip preserves the anchor, zeros inserts a zero contribution where possible, and error aborts. A lone secondary-only tensor is copied unchanged. |
| output_filename | STRING | cwb_merged_3_checkpoint | Filename without extension. The result is atomically written to this model category under ComfyUI's models directory. |
| save_dtype | COMBO | Requested dtype for generated floating tensors. Participating FP32 inputs keep a result FP32 unless Override Dtype is enabled. | |
| process_device | COMBO | Device used for per-layer FP32 CWB arithmetic. A CUDA out-of-memory error retries only the affected layer on CPU. | |
| exclude_patterns | STRING | One pattern per line. Matching layers are preserved from the anchor instead of merged. Uses regex unless Glob Patterns is enabled. | |
| discard_patterns | STRING | One pattern per line. Matching tensors or logical LoRA groups are omitted from the output. Uses regex unless Glob Patterns is enabled. | |
| glob_patterns | BOOLEAN | false | Interpret exclude and discard entries as shell-style glob patterns instead of regular expressions. |
| lazy_load | BOOLEAN | true | Use UEL low-memory loading so tensors are read and released per work unit instead of retaining the complete inputs in RAM. |
| force_clear_cache | BOOLEAN | true | Run Python garbage collection and clear the CUDA allocator cache before each layer. Reduces retained memory but can substantially slow merging. |
| override_dtype | BOOLEAN | false | Force generated tensors to save_dtype; guarded tensors and enabled 1D direct diffs are exempt. |
| cwb_configopt | CWB_CONFIG | Optional settings from CWB Custom Configuration. When connected, it completely overrides the selected preset. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output_filename | * | — |
| documentation | STRING | — |
| cwb_report | STRING | — |