Nodes/LoRA Optimizer/LoRA Optimizer Settings
ComfyUI Node

LoRA Optimizer Settings

The knobs behind LoRA Optimizer's defaults

By ethanfel·Created 5 months ago·Updated 23 days ago· 135
LoRA Optimizer Settings
  • merge_settings
  • settings
auto_strengthenabled
optimization_modeper_prefix
merge_refinementnone
sparsificationdisabled
sparsification_density0.70
dare_dampening0.00
patch_compressionsmart
svd_devicegpu
free_vram_between_passesdisabled
strategy_setfull
merge_strategy_override

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 (default enabled) - 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. global forces one strategy everywhere, which is closer to how older LoRA-merge tools worked. additive is 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, try refine first: it adds direction orthogonalization and TALL-mask "selfish weight" protection for minimal extra compute. full adds SVD-based alignment on top, at the cost of more VRAM during the merge - save it for stacks where refine still isn't enough.
  • sparsification - off by default. If you enable it, prefer the _conflict variants (dare_conflict, della_conflict) over plain dare/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.7 keeps 70%; lower is more aggressive and risks losing detail.
  • dare_dampening - only matters with dare/dare_conflict enabled. Controls how much surviving weights get boosted to compensate for the trim; 0 is 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; aggressive compresses everything (slightly lossy on TIES-merged prefixes); disabled skips compression entirely. Leave this on smart unless RAM after the merge is a real constraint.
  • svd_device - gpu by default and meaningfully faster. Only switch to cpu if 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_slerp and basic narrow 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.

CategoryLoRA Optimizer

Inputs (12)

NameTypeDefaultDescription
auto_strengthCOMBOenabledAutomatically turns down individual LoRA strengths when combining many LoRAs, preventing oversaturation. Recommended to keep enabled.
optimization_modeCOMBOper_prefixHow 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_refinementCOMBOnoneExtra 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.
sparsificationCOMBOdisabledRemoves 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_densityFLOAT0.700.01–1How 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_dampeningFLOAT0.000–1Controls how strongly surviving weights are boosted after sparsification trims some away. 0 = standard boost, higher = gentler. Only matters when sparsification is enabled.
patch_compressionCOMBOsmartShrinks 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_deviceCOMBOgpuWhere to run compression math. GPU is much faster. Switch to CPU only if you get out-of-memory errors.
free_vram_between_passesCOMBOdisabledFrees GPU memory between merge steps. Enable if you're running out of VRAM on large models. Barely affects speed.
strategy_setCOMBOfullWhich merge methods the optimizer can choose from. 'full' (recommended): all methods available including SLERP blending. 'no_slerp': excludes SLERP. 'basic': only simple averaging.
merge_settingsoptMERGE_SETTINGSConnect a LoRA Merge Settings node here to share common settings. Uses good defaults if not connected.
merge_strategy_overrideoptSTRINGForces one specific merge method everywhere instead of letting the optimizer choose. Connect from a LoRA Conflict Editor node.

Outputs (1)

NameTypeDescription
settingsOPTIMIZER_SETTINGS