Delta CWB Merge LoRAs (3)
The CWB consensus merge with a third vote
- cwb_config
- output_filename
- cwb_report
Add a third LoRA and the "average them and hope" school of merging gets worse in a hurry: when three independent LoRAs all touch the same layer, a plain mean buries anything only one of them believes in. Delta CWB Merge LoRAs (3) is the three-input version of the pack's Consensus-Weighted Blending merger, and three contributors is actually where CWB's logic shines - a majority vote can emerge. Each LoRA is expanded to its full per-layer weight change, then merged row by row using a mean or median consensus, with each contributor's effective weight set by how strongly its rows agree with that consensus. Rows that fight the group get suppressed; rows that reinforce it carry the output.
It's the same machinery as the two-input Delta CWB Merge LoRAs (2), just with lora_3 added as an equal-prior contributor. Everything else - presets, the optional custom-config override, output modes, and the cwb_report - carries over unchanged, which is good news because it means the controls you learn on the 2-input node transfer directly.
Inputs that matter
lora_1,lora_2,lora_3- dropdowns of your loras folder;lora_1anchors metadata and the output layer set.cwb_preset(defaultbalanced_mean) - six presets from simple mean/median blends (balanced_mean,robust_medn,selective_mean) up to the norm-aware, diversity-boosting ones (varied_mean_rn_softcb,diverse_medn_rn_dsc_softcb,strongdiv_medn_rn_dsc_softcb). With three inputs, the median-based presets (robust_medn,diverse_medn_rn_dsc_softcb) start to mean something concrete: the median row is the one two of three contributors agree on.cwb_config(optional) - plugging in the pack's CWB Custom Configuration node overrides the preset completely; leave it empty to use the named preset.mismatch_mode(defaultskip) - with three independently trained LoRAs, patchy layer coverage is normal.skipkeeps LoRA 1's layer,zeroscounts absent inputs as zero change,erroraborts rather than merge on incomplete data.output_representation/output_rank-full_differencesaves the exact merged dense deltas;factorized_lorare-factorizes each layer intolora_A/lora_Bfactors capped atoutput_rank(default 384) for a compact, conventional LoRA file.- Plus the shared set:
output_filename,save_dtype(defaultbf16),process_device(CUDA with per-layer CPU fallback),exclude_patterns/discard_patterns/glob_patterns, andforce_clear_cache.
Outputs: output_filename (the new .safetensors in your loras folder) and cwb_report, a text summary of merged vs. preserved layers, dtype breakdown, and CUDA fallbacks. Read the report on your first few merges - it's the fastest way to develop a feel for what the consensus weighting actually kept.
Realistic notes
This family is the pack's experimental edge, so treat outputs with healthy skepticism and compare against a plain three-LoRA stack before baking anything important. Expect it to raise on non-canonical LoRAs (DoRA-scale or low-bit factors) rather than merge them. Layer-at-a-time streaming keeps memory sane, and the atomic writer means a failed run won't clobber a same-named file - though a successful rerun will overwrite it. If your merge count is fluid, the Delta CWB LoRA Multi-Merge sibling handles 2–8 inputs with a lora_count selector; when you're fixed at three, this node's three dedicated slots are simpler to read at a glance.
Installing it
Same pack as the rest of ModelUtils. ComfyUI Manager: search Model Utility Toolkit. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-ModelUtils
Restart ComfyUI. No API keys or model downloads - it only reads LoRAs already in your models/loras folder. Find it under ModelUtils → LoRA → Merge → Delta CWB, or search "Delta". It sits alongside the classic merger tools (checkpoint/embedding mergers, MetaKeys, PruneKeys) that make this pack the one-stop shop for doing model surgery without leaving the graph.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| lora_1 | COMBO | Metadata and layer anchor. Defines saved layers and preserved values. | |
| lora_2 | COMBO | Equal-prior LoRA contributor. CWB determines its effective row influence. | |
| lora_3 | COMBO | Equal-prior LoRA contributor. CWB determines its effective row influence. | |
| cwb_preset | COMBO | balanced_mean | Controls how strongly agreement, disagreement, and row magnitude affect the saved full weight changes. A connected CWB Config overrides it completely. |
| mismatch_mode | COMBO | skip | For a missing or incompatible anchored layer: preserve LoRA 1, include an explicit zero contributor, or abort. |
| output_filename | STRING | delta_cwb_merged_3_lora | Relative filename for the atomically saved full-difference LoRA. |
| save_dtype | COMBO | bf16 | Requested saved precision. Participating FP32 inputs preserve FP32. |
| output_representation | COMBO | full_difference | Save exact full differences or factorize each merged layer directly into compact LoRA factors. |
| output_rank | INT | 3841–16384 | Maximum rank used when Output Representation is factorized_lora. |
| process_device | COMBO | cuda | Processing device. Only a failed CUDA layer retries on CPU. |
| exclude_patterns | STRING | Preserve matching canonical full-difference layers from LoRA 1. | |
| discard_patterns | STRING | Omit matching canonical full-difference layers from the output. | |
| glob_patterns | BOOLEAN | false | Use shell-style glob patterns instead of regular expressions. |
| force_clear_cache | BOOLEAN | true | Clear Python and CUDA caches before each layer to reduce retained memory. |
| cwb_configopt | CWB_CONFIG | Optional complete settings override from CWB Custom Configuration. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output_filename | * | — |
| cwb_report | STRING | — |