LoRA Optimizer Settings
The knobs behind LoRA Optimizer's defaults
- merge_settings
- settings
The plain LoRA Optimizer node runs on good defaults on purpose - you're meant to be able to plug in a stack and go. This node is what you reach for once you've hit a case the defaults don't cover: artifacts refuse to clean up, a merge is eating too much VRAM, or you specifically want to force one merge technique over another. Connect it to the Optimizer's (or Inline Chain's) settings input and it takes priority over tuner_data and the built-in defaults.
What it controls, and when to touch it
Most of these are fine left alone. The ones worth understanding:
auto_strength(defaultenabled) - automatically turns down per-LoRA strength as you stack more LoRAs, to stop oversaturation before it starts. Keep this on; turning it off means you're back to manually finding a safe combined strength yourself.optimization_mode-per_prefix(default) picks a merge method per weight group based on local conflict data, which is the whole point of this pack.globalforces one strategy everywhere, which is closer to how older LoRA-merge tools worked.additiveis simple weighted addition with no conflict handling at all - reach for this specifically when a LoRA in your stack is a DPO/edit LoRA you can't avoid including, since conflict resolution would otherwise trim weights that LoRA needs intact.merge_refinement-none(default, fastest) is fine for most stacks. If you're seeing artifacts or color shifts, tryrefinefirst: it adds direction orthogonalization and TALL-mask "selfish weight" protection for minimal extra compute.fulladds SVD-based alignment on top, at the cost of more VRAM during the merge - save it for stacks whererefinestill isn't enough.sparsification- off by default. If you enable it, prefer the_conflictvariants (dare_conflict,della_conflict) over plaindare/della: the plain versions trim weights everywhere, including places where LoRAs aren't actually fighting, which throws away signal you didn't need to lose. The conflict-aware versions only trim at genuine sign disagreements.sparsification_density- how much of each LoRA survives sparsification.0.7keeps 70%; lower is more aggressive and risks losing detail.dare_dampening- only matters withdare/dare_conflictenabled. Controls how much surviving weights get boosted to compensate for the trim;0is the standard rescale, higher values dampen it for a gentler (less noisy) result at low density.patch_compression-smart(default) losslessly shrinks the merged output where it can;aggressivecompresses everything (slightly lossy on TIES-merged prefixes);disabledskips compression entirely. Leave this onsmartunless RAM after the merge is a real constraint.svd_device-gpuby default and meaningfully faster. Only switch tocpuif you're hitting out-of-memory errors during compression.free_vram_between_passes- off by default. Flip it on if VRAM is genuinely tight on a large model; the speed cost is small.strategy_set-full(default) lets the optimizer choose from every merge method including SLERP.no_slerpandbasicnarrow the pool if you want more predictable, simpler behavior.
The inputs and output
Two optional connections beyond the widgets above: merge_settings to share common settings from a LoRA Merge Settings node instead of using this node's defaults, and merge_strategy_override to force one specific merge method everywhere - this is meant to be fed from a LoRA Conflict Editor's output rather than typed by hand. Output is a single settings (OPTIMIZER_SETTINGS) - connect it to the settings input on LoRA Optimizer or LoRA Optimizer (Inline Chain).
How to install it
ComfyUI Manager: search "LoRA Optimizer", install, restart. Or manually:
cd ComfyUI/custom_nodes/
git clone https://github.com/ethanfel/ComfyUI-LoRA-Optimizer.git
Restart ComfyUI - nodes appear under loaders. Nothing to download; this node is pure configuration.
Common issues & troubleshooting
You connected it but nothing changed. Double-check the settings input is wired to the actual Optimizer node doing the merging - it's easy to build this on the side and forget the final connection, especially in a busy graph.
Merge is noticeably slower now. merge_refinement=full and enabling sparsification both add real compute. If you don't need the extra quality on a given stack, drop back to none/disabled rather than leaving the heaviest settings on for every run.
Out of VRAM during the merge, not during sampling. That's the compression or refinement pass, not your sampler. Try svd_device=cpu or free_vram_between_passes=enabled before assuming your GPU can't handle the stack at all.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| auto_strength | COMBO | enabled | Automatically turns down individual LoRA strengths when combining many LoRAs, preventing oversaturation. Recommended to keep enabled. |
| optimization_mode | COMBO | per_prefix | How the optimizer picks merge methods. 'per_prefix' (recommended): picks the best method for each part of the model. 'global': uses one method everywhere. 'additive': simple stacking with no conflict handling — use for edit/DPO LoRAs. |
| merge_refinement | COMBO | none | Extra processing to reduce interference between LoRAs. 'none': fastest, usually fine. 'refine': light cleanup for better quality. 'full': most thorough but slower. Try 'refine' if you see artifacts or color shifts. |
| sparsification | COMBO | disabled | Removes low-impact weights before merging to reduce interference between LoRAs. The 'conflict' variants (recommended if enabling) only trim where LoRAs disagree, leaving unique contributions intact. |
| sparsification_density | FLOAT | 0.700.01–1 | How much of each LoRA to keep when sparsification is enabled. 0.7 = keep 70%. Lower values are more aggressive — reduces interference but may lose detail. |
| dare_dampening | FLOAT | 0.000–1 | Controls how strongly surviving weights are boosted after sparsification trims some away. 0 = standard boost, higher = gentler. Only matters when sparsification is enabled. |
| patch_compression | COMBO | smart | Shrinks the merged result to use less memory. 'smart' (recommended): only compresses where it's lossless. 'aggressive': compresses everything, saves more memory but slightly lossy. 'disabled': no compression. |
| svd_device | COMBO | gpu | Where to run compression math. GPU is much faster. Switch to CPU only if you get out-of-memory errors. |
| free_vram_between_passes | COMBO | disabled | Frees GPU memory between merge steps. Enable if you're running out of VRAM on large models. Barely affects speed. |
| strategy_set | COMBO | full | Which merge methods the optimizer can choose from. 'full' (recommended): all methods available including SLERP blending. 'no_slerp': excludes SLERP. 'basic': only simple averaging. |
| merge_settingsopt | MERGE_SETTINGS | Connect a LoRA Merge Settings node here to share common settings. Uses good defaults if not connected. | |
| merge_strategy_overrideopt | STRING | Forces one specific merge method everywhere instead of letting the optimizer choose. Connect from a LoRA Conflict Editor node. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| settings | OPTIMIZER_SETTINGS | — |