Nodes/Model Utility Toolkit/CWB Custom Configuration
ComfyUI Node

CWB Custom Configuration

Take the wheel from CWB presets — the config node behind every CWB merge

By silveroxides·Created about a year ago·Updated about 24 hours ago· 14
CWB Custom Configuration
    • cwb_config
    consensus_typemedian
    alignment_methodsimilarity
    alignment_threshold0.00
    similarity_threshold0.00
    power_alpha2.0
    diversity_beta10.0
    rescale_normtrue
    global_scale1.00
    dynamic_similarity_contrastfalse
    soft_comfort_bandpasstrue
    position_weight0.05
    preserve_common_prefixfalse

    Every CWB merger in this pack ships with named presets like balanced_mean or broad_sim_medn_rn_softcb. Those presets are complete settings, not partial hints - but they're also opaque, and the names only tell you so much. This node is the manual override: it exposes every knob in the Consensus-Weighted Blending math and hands the result to any CWB merger through its optional cwb_config input. Connect it and the preset is ignored completely; the config becomes the whole settings object.

    What the knobs actually do

    • consensus_type (mean / median, default median) - the center each contributor is compared against. Mean is the symmetric arithmetic center; median is more robust when you have three or more contributors and one might be an outlier. For two inputs it barely matters; for three or more, median is the safer default.
    • alignment_method (index / similarity, default similarity) - how vectors get paired when the merge type supports alignment (LoRA and embeddings). Index keeps absolute row positions; similarity greedily pairs rows by cosine. Dense models ignore this - their coordinates are fixed.
    • alignment_threshold (0–1) - minimum cosine score for accepting a similarity-aligned row match. Raise it to only align rows that genuinely resemble each other.
    • similarity_threshold (-1–1) - minimum similarity to the group consensus before a contributor gets weight at all. Raise it to make the merge more selective.
    • power_alpha (0–10, default 2) - the exponent applied to accepted similarities before weighting. Higher values make close-to-consensus contributors dominate more; this is the single most influential "how aggressive is the blend" knob.
    • diversity_beta (0–10, default 10) - the bandpass exponent that suppresses near-consensus dominance, so a contributor that's too similar doesn't crowd everyone out. Zero disables it.
    • rescale_norm (default on) - after weighting, set each merged vector's norm to the mean participating norm. Keeps the output's scale sane; leave it on.
    • global_scale (0–10, default 1) - a final multiplier on the contribution. For LoRA it's applied through the up factor. A cheap overall strength dial.
    • dynamic_similarity_contrast (default off) - remaps unequal consensus similarities into the 0.7–1.0 range before alpha/beta weighting, stretching the differences so they matter more.
    • soft_comfort_bandpass (default on) - uses 1.5 − similarity instead of 1.001 − similarity for the diversity weighting; the softer curve behaves better when contributors are similar.
    • position_weight (0–1, default 0.05) - how much positional affinity blends into similarity-based greedy matching. Small values are right.
    • preserve_common_prefix (default off) - copies a numerically identical leading span straight from the anchor instead of blending it. Handy when two models share an identical frozen prefix.

    How to use it

    Wire the cwb_config output into the optional cwb_config input on any CWB merger - two or three model/checkpoint/text-encoder/LoRA/embedding variant. The tooltip is explicit: when connected, it completely overrides the selected preset. So the workflow is: leave the merger on any preset you like as a fallback, then use this node when you want exact control.

    A sane starting point for most merges: keep median, similarity_threshold around 0–0.3, power_alpha 2–3, diversity_beta 4–10, rescale_norm on. The counterfactual_weight_sweep toggle on CWBLoRAMultiMerger is a great way to probe how sensitive your merge is to these values without running a dozen merges - set up a config you're curious about and let the sweep tell you if it matters.

    Install

    Part of Model Utility Toolkit (silveroxides/ComfyUI-ModelUtils). 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 current - the pack uses the newer extension API.

    CategoryModelUtils/Merging/Configuration

    Inputs (12)

    NameTypeDefaultDescription
    consensus_typeCOMBOmedianMean is a symmetric center; median is more robust with three or more contributors.
    alignment_methodCOMBOsimilarityPair vectors by position or greedy cosine similarity where the merge type supports alignment.
    alignment_thresholdFLOAT0.000–1Minimum cosine product or score for accepting a similarity-aligned row match.
    similarity_thresholdFLOAT0.00-1–1Minimum contributor similarity to the group consensus before weighting.
    power_alphaFLOAT2.00–10Exponent applied to accepted non-negative consensus similarities.
    diversity_betaFLOAT10.00–10Bandpass exponent used to suppress near-consensus dominance; zero disables it.
    rescale_normBOOLEANtrueSet each merged vector norm to the mean participating norm after weighting.
    global_scaleFLOAT1.000–10Multiply the final contribution once; LoRA applies this through the up factor.
    dynamic_similarity_contrastBOOLEANfalseRemap unequal consensus similarities into 0.7 to 1.0 before alpha and beta weighting.
    soft_comfort_bandpassBOOLEANtrueUse 1.5 minus similarity instead of 1.001 minus similarity for diversity weighting.
    position_weightFLOAT0.050–1Blend positional affinity into similarity-based greedy matching.
    preserve_common_prefixBOOLEANfalseCopy a numerically identical leading component span from the anchor.

    Outputs (1)

    NameTypeDescription
    cwb_configCWB_CONFIG