Nodes/WAS_Extras/WAS Power LoRA Merger Options
ComfyUI Node

WAS Power LoRA Merger Options

The tuning knobs behind WAS Power LoRA Merger

By WASasquatch·Created 3 years ago·Updated 17 days ago· 43
WAS Power LoRA Merger Options
    • options
    rank32
    auto_rank_threshold0.9900
    preserve_normfalse
    cap_mult_enablefalse
    cap_mult1.00
    dtypebf16
    compute_dtypeauto
    cpufalse
    include_patterns
    exclude_patterns
    moe_temperature1.00
    moe_hardfalse
    block_mix_methodsvd
    block_mix_presetauto
    block_mix_weightedfalse
    block_mix_concept_mix0.50
    block_mix_style_mix0.50

    This node produces nothing on its own - it's a settings bundle you plug into the options input on WAS Power LoRA Merger (its own article, and the node that actually does the merging). It's optional there, so you only need this when the merger's own defaults for your chosen mode aren't giving you what you want.

    How it works

    The fields are grouped by which merge mode they affect, and most of them are inert unless the Merger is set to the matching mode. Roughly:

    SVD / rank group (affects svd, rebase, add-diff, add-orth, diff-export, moe): rank (default 32; set to 0 for auto-rank based on an energy threshold), auto_rank_threshold (default 0.99, only used when rank is 0 - higher keeps more singular-value energy, meaning a larger effective rank), preserve_norm (svd only - keeps the average per-module delta norm stable after merging, so overall strength doesn't drift), and cap_mult_enable/cap_mult (svd only - hard-caps the merged module norm to cap_mult × mean(source norms), a safety rail against one LoRA's contribution dominating).

    Precision: dtype (default bf16 - what gets saved to disk), compute_dtype (default auto - the internal merge math precision; auto prefers bf16 when it hits mixed input dtypes), and cpu (force the merge onto CPU instead of GPU - slower, but frees VRAM if your GPU is busy).

    Filtering: include_patterns/exclude_patterns - comma-separated substrings matched against module name prefixes, so you can restrict a merge to (say) only attention blocks, or exclude specific modules, without touching the rest of the LoRA.

    MoE group (only used in the Merger's moe mode): moe_temperature (default 1 - softmax temperature for expert gating; lower means sharper, more winner-take-all selection) and moe_hard (skip the soft mixture and hard-pick a single best expert per module instead).

    Block-mix group (only used in the Merger's block-mix mode): block_mix_method (svd = delta-merge-then-recompress, stack = exact rank stacking with no compression), block_mix_preset (routing families that match how different architectures actually name their blocks - zimg-turbo, flux, wan, qwen, sd, sdxl, or generic/auto), block_mix_weighted (turns hard A-or-B routing into a blend), and block_mix_concept_mix/block_mix_style_mix (when weighted, what fraction of LoRA A survives in concept/attention versus style/feed-forward modules - 0.5 splits evenly).

    The inputs and outputs that matter

    For a first merge you mostly need rank and dtype - leave the moe_* and block_mix_* groups alone unless the Merger node's mode is actually moe or block-mix, where they're otherwise inert. Output is a single options (WAS_LORA_MERGE_OPTIONS) socket that only plugs into the Merger's options input - nowhere else.

    How to install it

    Via ComfyUI Manager: search WAS_Extras, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/WASasquatch/WAS_Extras
    

    Restart ComfyUI. No extra dependencies.

    Common issues & troubleshooting

    Changed block_mix_* or moe_* settings and nothing happened. Check the Merger node's mode dropdown first - those groups are only read in block-mix and moe mode respectively. Everything else ignores them.

    Merged LoRA looks washed out or has lost detail. rank too low, or auto_rank_threshold set too aggressively for an SVD-family mode - raise the rank, or push the threshold closer to 1.0 to keep more of the singular-value energy.

    A merge that should take seconds is taking minutes. Check whether cpu got left on - it trades speed for VRAM headroom, and it's easy to forget you enabled it for a previous run.

    Confused about dtype vs compute_dtype. dtype is what gets written to your .safetensors file. compute_dtype is only the precision used during the merge math itself - you can compute in fp32 for accuracy and still save the result as bf16 to keep the file small.

    CategoryWAS Extras

    Inputs (17)

    NameTypeDefaultDescription
    rankINT320–4096Rank for SVD-based modes (svd, rebase, add-diff, add-orth, diff-export, moe). Set to 0 to use auto-rank (energy threshold).
    auto_rank_thresholdFLOAT0.99000.5–1Auto-rank energy threshold for SVD-based modes when rank=0. Higher values keep more singular-value energy (larger rank).
    preserve_normBOOLEANfalsesvd mode only: preserve average per-module delta norm after merging (helps prevent overall strength drift).
    cap_mult_enableBOOLEANfalsesvd mode only: enable capping merged per-module norm (cap_mult × mean(source_norms)).
    cap_multFLOAT1.000–100svd mode only (when cap_mult_enable is on): cap merged module norm to cap_mult × mean(source module norms).
    dtypeCOMBObf16Output dtype for the saved LoRA tensors.
    compute_dtypeCOMBOautoInternal merge dtype alignment. auto => if mixed dtypes are encountered, prefer bf16; otherwise use existing dtype.
    cpuBOOLEANfalseForce CPU even if CUDA is available (slower but avoids VRAM usage).
    include_patternsSTRINGOptional filter: only merge modules whose prefix contains any of these substrings. Comma-separated list (whitespace is trimmed).
    exclude_patternsSTRINGOptional filter: exclude modules whose prefix contains any of these substrings. Comma-separated list (whitespace is trimmed).
    moe_temperatureFLOAT1.000.000001–100moe mode only: softmax temperature for expert gating (lower = sharper selection).
    moe_hardBOOLEANfalsemoe mode only: hard gating (pick a single best expert per module) instead of soft mixture.
    block_mix_methodCOMBOsvdblock-mix mode only: svd (delta merge then SVD) or stack (exact rank stacking).
    block_mix_presetCOMBOautoblock-mix mode only: routing preset family.
    block_mix_weightedBOOLEANfalseEnable weighted block-mix (blend A/B per module using role-specific mix ratios).
    block_mix_concept_mixFLOAT0.500–1When weighted block-mix is enabled: fraction of LoRA A to use for concept/attention modules (B = 1 - A).
    block_mix_style_mixFLOAT0.500–1When weighted block-mix is enabled: fraction of LoRA A to use for style/FFN modules (B = 1 - A).

    Outputs (1)

    NameTypeDescription
    optionsWAS_LORA_MERGE_OPTIONS