LoRA AutoTuner Settings
Give the plain Optimizer node AutoTuner's sweep
- merge_settings
- evaluator
- settings
There are two ways to get AutoTuner's parameter-sweep behavior into your workflow: the standalone LoRA AutoTuner node, which takes its own model/lora_stack inputs and runs independently, or this node, which packages the same sweep logic as an OPTIMIZER_SETTINGS object you plug into the plain LoRA Optimizer's settings input. If you've already got LoRA Optimizer wired into a graph and just want it to sweep instead of using fixed settings, this is less rewiring than swapping in the standalone AutoTuner node.
How it works
Same underlying sweep as LoRA AutoTuner - Pass 1 analysis once, heuristic scoring across candidate configs, real merge-and-measure on the top top_n. The difference is purely architectural: this node doesn't own the merge, it hands its settings to whatever node's settings input it's connected to, and that node runs the actual merge.
The inputs that matter
top_n(default3) - how many top-scoring configs get a real merge-and-measure pass. This is the main dial for the speed/thoroughness tradeoff.scoring_speed(defaultturbo) -fullscores every weight prefix per candidate (most accurate, slowest - worth it for stacks combining very different LoRAs, like style + character in one stack).fast/turbo/turbo+sample progressively fewer prefixes;turbo+is the one to reach for on large models like Flux or WAN, or when you're iterating quickly and can tolerate missing subtle block-level differences.scoring_svd(defaultdisabled) - the default fast norm-only scoring is usually enough.merge_qualityandlora_rankadd SVD-based analysis for more thorough (and slower) scoring; both are hardware-accelerated if Triton is installed.diff_cache_mode(defaultauto) - caches raw LoRA diffs across candidates instead of recomputing them each time, since diffs depend only on the LoRA content, not the merge config.autouses RAM up todiff_cache_ram_pctand recomputes anything past that budget rather than spilling to disk.community_cache(defaultdisabled) - download precomputed results for LoRAs matching your exact file content from a shared Hugging Face dataset, and optionally contribute your own back withupload_and_download(requires anHF_TOKENenvironment variable for uploads; downloads need nothing).memory_mode(defaultauto) - persists a tuned result across ComfyUI sessions keyed by LoRA names, strengths, and settings, so re-running the same stack replays the winning config instantly instead of re-sweeping.auto_ignore_strengthis worth knowing about specifically if you're sweeping strength values on orthogonal LoRAs, where the ranking usually doesn't change with strength anyway.selection(default1) - which ranked config to actually apply, without re-running the sweep to try alternatives.
Optional connections: merge_settings to inherit shared settings from a Merge Settings node, and evaluator to blend in a custom Python scoring function via Build AutoTuner Python Evaluator.
Output: settings (OPTIMIZER_SETTINGS) - connect to the settings input on LoRA Optimizer.
How to install it
ComfyUI Manager: search "LoRA Optimizer", install, restart. Manually:
cd ComfyUI/custom_nodes/
git clone https://github.com/ethanfel/ComfyUI-LoRA-Optimizer.git
Restart - nodes appear under loaders. No downloads unless you turn on community_cache, which talks to Hugging Face.
Common issues & troubleshooting
Heavy RAM usage on large stacks or video models. This node runs the same sweep machinery as the standalone AutoTuner, and it carries the same real-world cost - a reported case running 3 LoRAs on Wan 2.2 through the AutoTuner sweep nearly filled 96GB of RAM before crashing. Set diff_cache_mode to disk instead of the default auto, and reconsider whether a full sweep is worth it on every iteration for video-model stacks specifically.
Connected this node but the Optimizer still looks like it's using fixed settings. Confirm the settings output is actually wired into LoRA Optimizer's settings input, not left dangling - a settings connection silently overrides tuner_data and defaults, so if it's not connected, nothing about this node's configuration takes effect.
Sweep runs every single execution, even when nothing changed. That's what memory_mode=auto is for - it should replay a cached result rather than re-sweeping once a stack's LoRAs and settings match a previous run. If it's re-sweeping anyway, double check nothing about the stack (even a strength value, unless you're using auto_ignore_strength) actually changed between runs.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| top_n | INT | 31–10 | How many of the best configurations to try with a real merge. Higher = explores more options but takes longer. |
| scoring_svd | COMBO | disabled | SVD-based scoring for ranking configurations. disabled: fast norm-only scoring (usually sufficient). merge_quality: SVD on merged diff tensors — more thorough quality measurement. lora_rank: effective rank of LoRA factors — experimental, changes ranking. full: both merge_quality + lora_rank. With Triton installed, SVD modes are hardware-accelerated and add minimal overhead. |
| scoring_device | COMBO | gpu | Where to run scoring math. GPU is much faster, especially with SVD scoring modes. |
| scoring_speed | COMBO | turbo | How thoroughly to score each configuration. 'full': most accurate, slowest. 'turbo' (recommended): good balance of speed and accuracy. 'turbo+': fastest, may miss subtle differences. |
| scoring_formula | COMBO | v2 | Which scoring formula to use. v2 (recommended): smarter scoring that adapts to your model type. v1: older formula, kept for comparison. |
| diff_cache_mode | COMBO | auto | Caches intermediate data to speed up the sweep. 'auto' (recommended): uses RAM up to diff_cache_ram_pct, then recomputes the rest (no disk). 'disabled': slower but uses no extra memory. |
| diff_cache_ram_pct | FLOAT | 0.500.1–0.9 | How much of your free RAM the diff cache can use (in 'auto' mode). 0.5 = up to half your available RAM. |
| community_cache | COMBO | disabled | Community cache: share and reuse LoRA analysis results via Hugging Face. upload_only: run locally and upload results; do NOT replay HF cache hits. Useful for backfilling enriched configs. upload_and_download: download cached results before analysis and upload new ones after. Requires HF_TOKEN environment variable. |
| memory_mode | COMBO | auto | Persistent memory for tuning results across sessions. auto: Load cached results if available, save after tuning. auto_ignore_strength: Same as auto but the cache key ignores LoRA strengths — useful when sweeping strengths on orthogonal LoRAs where rankings don't change. read_only: Use cached results but don't save new ones. clear_and_run: Delete cached entry and re-tune from scratch. |
| selection | INT | 11–10 | Which ranked configuration to apply (1 = top-ranked). Change this to try a different config without re-running the full sweep. |
| record_dataset | COMBO | disabled | Append analysis metrics and all scored configs to user/lora_optimizer_reports/autotuner_dataset.jsonl for threshold-tuning research. Entries are recorded only when a full sweep runs (cache/memory replays don't add entries). |
| merge_settingsopt | MERGE_SETTINGS | Connect a LoRA Merge Settings node here to share common settings. Uses good defaults if not connected. | |
| evaluatoropt | AUTOTUNER_EVALUATOR | Connect an external evaluator to influence how configurations are ranked. Optional — the built-in scoring works well on its own. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| settings | OPTIMIZER_SETTINGS | — |