Nodes/LoRA Optimizer/LoRA Merge Settings
ComfyUI Node

LoRA Merge Settings

The advanced dial-pack for when a merge comes out fried

By ethanfel·Created 5 months ago·Updated 23 days ago· 135
LoRA Merge Settings
    • merge_settings
    normalize_keysenabled
    architecture_presetauto
    auto_strength_floor0.85
    decision_smoothing0.25
    smooth_slerp_gatefalse
    vram_budget0.00
    cache_patchesenabled
    auto_strength_floor_modeauto
    star_eta100
    tame_layers0.00
    tame_threshold0.30

    This node doesn't merge anything. It's a bundle of advanced knobs that plugs into the merge_settings input on an Optimizer Settings or AutoTuner Settings node - a way to hand a pile of fine-tuning options to the actual merge nodes without cluttering them. If you've never seen this node before, that's normal: the defaults are good, and most people should never need it. It exists for the specific moment your merged LoRA stack comes out looking wrong and you want to know which lever to pull.

    Some context on why that moment happens at all: stacking LoRAs is famously unpredictable - interactions between two or three style/character LoRAs can produce oversaturation or artifacts that neither one shows alone. The LoRA Optimizer's whole job is figuring out, per layer, whether your LoRAs agree or fight and picking a merge strategy accordingly. Most of the time its automatic choices are right. This node is where you go when they aren't quite.

    What each setting actually does

    The bundle covers three rough categories. Leave-alone-unless-broken: normalize_keys (remaps LoRA keys from different trainers like Kohya/AI-Toolkit/PEFT to a common format so mixed-trainer stacks merge correctly - keep it enabled) and architecture_preset (auto-detects SD/SDXL vs. DiT vs. LLM-style thresholds; only override if auto-detection is visibly wrong for your model).

    Stability tuning, for when re-running the same stack gives you inconsistent-feeling results layer to layer: decision_smoothing (0.25 default) blends each layer's merge-strategy decision toward its neighbors' average so adjacent layers don't flip between "average" and "TIES" on noisy data - 0.2–0.4 is the sane range. smooth_slerp_gate makes the SLERP blending decision use a smoothed per-layer similarity score instead of a single global one; try it if results feel inconsistent between runs.

    Rescue knobs, for when the merge is actually fried - oversaturated, blown-out, "burned" the way an overcooked CFG value looks: tame_layers (0 = off) caps individual LoRA layers whose weight delta is disproportionately large relative to the base weight, which is exactly the kind of "hot layer" that pushes activations off-manifold and causes frying; 1.0 fully clamps them. tame_threshold (default 0.3) sets how hot a layer has to be before taming kicks in - lower means more aggressive. star_eta (default 100 = off) is a separate per-LoRA spectral-cleaning pass: values below 100 SVD each LoRA layer and keep only the singular components carrying that percentage of the signal, which helps when you're merging many or heavily conflicting LoRAs but will just discard fine detail on a clean 2–3-LoRA merge, so leave it at 100 unless you're in "many conflicting LoRAs" territory. Rounding out the memory side: vram_budget and cache_patches control where merge results live (system RAM vs. GPU) - the same tradeoff you'll see on the main Optimizer node.

    auto_strength_floor and auto_strength_floor_mode deserve a specific mention: auto-strength (on the Optimizer itself) automatically turns down individual LoRA strengths to stop combined stacks from overexposing, and the floor here is how far it's allowed to shrink them - auto picks an architecture-aware default (motion-heavy video models get a gentler floor than image models), manual lets you set the floor slider yourself, down to 0 (no limit) or up to 1.0 (never shrink at all).

    Output

    A single MERGE_SETTINGS object - wire it into an Optimizer or AutoTuner Settings node's merge_settings input. It doesn't connect to a model, sampler, or LoRA stack directly.

    Installing it

    Same pack as everything else here. Easiest path: open ComfyUI Manager, search "LoRA Optimizer," install, restart. Manual install if you prefer:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/ethanfel/ComfyUI-LoRA-Optimizer.git
    

    Restart ComfyUI afterward - nodes show up under the loaders category, and this node specifically lives in the same node picker group as the rest of the LoRA Optimizer family. No model downloads, no extra dependencies to worry about here.

    When to actually reach for this node

    Skip it entirely on a first pass - build your stack, connect the plain Optimizer, look at the result. Come back to this node only if: the merge looks oversaturated or "fried" (try tame_layers first), you're merging four or more LoRAs and it feels like they're stepping on each other (star_eta below 100), or results feel unstable between otherwise-identical runs (decision_smoothing, smooth_slerp_gate). If none of that describes your problem, the widgets on the Optimizer node itself - auto_strength, sparsification, merge_refinement - are more likely to be the fix, and this node isn't the first place to look.

    CategoryLoRA Optimizer

    Inputs (11)

    NameTypeDefaultDescription
    normalize_keysCOMBOenabledEnsures LoRAs from different training tools (Kohya, PEFT, etc.) work together. Keep enabled unless you have a specific reason to disable.
    architecture_presetCOMBOautoTells the optimizer what type of model you're using so it can pick the best merge settings. 'auto' detects it for you. 'acestep_dit' is tuned for ACE-Step music LoRA merging with voice preservation. Only change if auto-detection gets it wrong.
    auto_strength_floorFLOAT0.850–1Manual auto-strength floor — used only when auto_strength_floor_mode = 'manual'. Limits how much auto-strength may shrink your LoRA strengths: 1.0 = don't shrink at all, 0.5 = shrink to at most half, 0 = no floor at all (remove the limit — auto-strength may shrink strengths all the way down). It's a floor on a uniform down-scale multiplier — auto-strength never scales UP and never flips signs, so this applies to negative LoRAs by magnitude (−1.75 → −1.49 at 0.85, sign kept) and to >1.0 strengths (1.7 → 1.45 at 0.85).
    decision_smoothingFLOAT0.250–1Prevents the optimizer from picking wildly different merge methods for similar layers. Higher values = more consistent choices across the model. 0.2-0.4 is usually a good range.
    smooth_slerp_gateBOOLEANfalseChanges how the optimizer decides when to use SLERP blending. When enabled, the decision is smoother and more stable. Try enabling if you notice inconsistent results between runs.
    vram_budgetFLOAT0.000–1How much GPU memory to use for storing merge results. 0 = keep everything in system RAM (safest). Increase to use GPU memory and reduce RAM usage.
    cache_patchesCOMBOenabledKeeps the merge result in memory so re-running the workflow is instant. Disable to free RAM — recommended for large video models.
    auto_strength_floor_modeCOMBOautoHow the auto-strength floor is chosen. 'auto' (recommended): architecture-aware default — higher (less shrink) for motion-heavy video models, lower for image models. 'manual': use the auto_strength_floor slider above. This only bounds the shrink — to turn auto-strength OFF entirely set auto_strength = disabled on the Optimizer Settings node (AutoTuner mode has no such toggle: it sweeps auto-strength on AND off automatically). For on-but-never-shrink, use manual with floor 1.0.
    star_etaFLOAT10010–100Per-LoRA spectral cleaning (STAR). 100 = OFF. Lower values SVD each LoRA layer, keep the top singular components reaching this %% of the nuclear norm, and rescale to preserve magnitude — reduces interference when merging MANY or CONFLICTING LoRAs. Leave at 100 for 2-3 orthogonal LoRAs (it would just discard fine detail). Try 60-80 when merging many conflicting LoRAs.
    tame_layersFLOAT0.000–1Per-LoRA magnitude taming strength. 0 = OFF. Caps 'hot' layers whose delta is a large fraction of the base weight (they push activations off-manifold and cause oversaturation/frying). 0.5 = gentle, 1.0 = fully cap hot layers to tame_threshold x the base-weight norm. Turn on if a merge comes out fried; preserved (style) LoRAs are exempt.
    tame_thresholdFLOAT0.300.05–2A layer is 'hot' when its delta Frobenius norm exceeds this fraction of the base weight's norm. Only used when tame_layers > 0. Lower = tame more layers (more aggressive); 0.3 is a sensible starting point. Dial by eye on the output.

    Outputs (1)

    NameTypeDescription
    merge_settingsMERGE_SETTINGS