Override _displayValue getter on combo widgets to strip directory
paths, showing only the filename for readability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use running Y offset with per-type spacing: 150px for LoraLoader
nodes, 300px for LoRAStackDynamic nodes. Prevents solo loader
nodes from overlapping each other.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove custom DOM widget for report text — rely on ComfyUI's
built-in ui.text and ui.images rendering instead. JS extension
now only handles node creation/cleanup logic.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Solo LoRAs now create LoraLoader/LoraLoaderModelOnly nodes (based on CLIP)
- Merge groups continue creating LoRAStackDynamic nodes
- Use original strengths instead of auto-strengths for created nodes
- Add create_nodes toggle to disable automatic node creation
- Move smooth_slerp_gate from AutoTunerSettings to shared MergeSettings
- Add smooth_slerp_gate to main LoRAOptimizer and _SIMPLE_DEFAULTS
- Add decision_smoothing (0.25) to _SIMPLE_DEFAULTS
- Remove output_mode from AutoTunerSettings (hardcode "merge")
- Rewrite all settings node tooltips for clarity
- Update tests for new settings structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds "Swap to LoRA AutoTuner" / "Swap to LoRA Optimizer" to the
right-click context menu. Transfers shared widget values, reconnects
all matching inputs/outputs by name, and removes the old node.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three compounding bugs caused saved LoRAs to be 2.3GB (instead of ~350MB) and
produce absurd images:
1. QKV refusion expanded all SVD-compressed LoRAAdapters to full-rank float32
diffs, destroying all compression. SaveMergedLoRA saw 0 low-rank patches.
2. With no surviving LoRAAdapters, auto-rank fell back to 128 — too low for
a merge of two rank-128 LoRAs (needs sum_rank=256), losing ~50% of signal.
3. _compress_to_lowrank returned float32 tensors (SVD needs float32 internally
but never cast back), doubling file size vs expected fp16.
Fixes:
- _compress_to_lowrank now preserves input dtype (also halves merge-time RAM)
- QKV refusion downcasts fused diffs back to original dtype
- Optimizer passes sum_rank in lora_data so SaveMergedLoRA uses correct rank
- SaveMergedLoRA detects native dtype and enforces it on all saved tensors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove slot name check for AutoTuner output connections (name
may differ from RETURN_NAMES in some frontends)
- Preserve node width when resizing after widget toggle
- Defer initial hide to after node layout is finalized
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These widgets are only relevant when AutoTuner and Optimizer are
linked via tuner_data. Hidden by default, shown on connection,
reset to defaults on disconnect.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Single model line workflow: AutoTuner → Optimizer. Only one node
merges at a time — the other is passthrough. A JS bridge syncs
the two switches as opposites when tuner_data is connected.
LoRAOptimizer:
- Add settings_source (manual/from_autotuner) and tuner_data inputs
- New execute_node entry point: from_autotuner = passthrough with
widget sync via UI data, manual = normal merge
- Subclass safety: LoRAOptimizerSimple and WanVideoLoRAOptimizer
explicitly set FUNCTION="optimize_merge" to bypass bridge
LoRAAutoTuner:
- Add output_mode (merge/tuning_only): tuning_only skips final
merge and returns base model unchanged while still outputting
scored tuner_data for downstream use
- Fix pre-existing bug: two error paths returning 5-element tuples
instead of required 6
JS (new lora_optimizer_bridge.js):
- onExecuted: sync Optimizer widgets from applied_settings
- Opposing switch sync with recursion guard:
from_autotuner ↔ merge, manual ↔ tuning_only
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The widget now controls visibility of multiple advanced settings (conflict
mode, key filter) beyond just strength sliders, so the name better reflects
its purpose.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate key_filter from a stack-wide setting on LoRAStackDynamic to a
per-LoRA per-slot control. Users can now filter keys independently for
each LoRA (e.g. "only take unique VACE keys from LoRA #2") without
chaining multiple stacker nodes.
- LoRAStack: add key_filter dropdown (all/shared_only/unique_only)
- LoRAStackDynamic: replace node-level key_filter with per-slot
key_filter_{i}; hide conflict_mode and key_filter in simple mode
- _normalize_stack: propagate key_filter from both tuple and dict formats
- _compute_cache_key: include per-entry key_filter, remove sentinel logic
- _merge_one_prefix: filter per-LoRA in both low-rank and full-rank paths
using raw n_loras from Pass 1
- _build_report: show key_filter per-LoRA instead of globally
- Add LoRAOptimizerSimple with sensible defaults; rename existing
optimizer to "LoRA Optimizer (Advanced)"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switching dropdown->text copies COMBO values to text fields.
Switching text->dropdown matches text values against COMBO options
by exact path, filename stem, or path suffix.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename "mode" to "strength_mode" to avoid confusion with "input_mode".
Restore base_model_filter for dropdown mode (hidden in text mode).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New "input_mode" widget switches between dropdown and text modes:
- "dropdown": COMBO dropdowns to browse and pick LoRAs (original behavior)
- "text": STRING text inputs for typing short names or connecting text nodes
Both modes share the same strength/conflict_mode controls. Text mode
resolves short names (filename without path/extension) to full paths
via _resolve_lora_name. JS toggles lora_name_N vs lora_name_text_N
visibility based on input_mode.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace COMBO dropdowns with STRING text inputs so users can type
short LoRA names (e.g. "Milena_20260216180133") or connect text nodes
directly. Names are resolved to full paths via _resolve_lora_name.
Remove base_model_filter (no longer applicable without COMBO widgets).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the autocomplete JS class (was ~155 lines). Instead, resolve
short LoRA names server-side: typing "Milena_20260216180133" matches
against installed LoRAs by filename stem, so it resolves to e.g.
"ZImageTurbo/character/Milena_20260216180133.safetensors". No Lora
Manager dependency needed — just plain text input with smart matching.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a multiline text widget where users can type LoRA paths directly
(one per line) with optional strength values. Supports three formats:
path.safetensors (strength 1.0), path:0.8 (both), path:0.8:0.5
(model:clip). When ComfyUI-Lora-Manager is installed, a lightweight
autocomplete dropdown suggests matches via its API. Works without
Lora Manager too (no autocomplete, user types exact paths).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix absolute→relative path matching (endsWith against fullLoraList)
- Fix page_size cap (paginate through all pages, build local map)
- Add explicit base_model_filter param to build_stack (no kwargs leak)
- Add retry when widget options not yet populated
- Preserve selected LoRA value when filter changes (no silent reset)
- Handle workflow restore (apply filter after interceptor setup)
- Extract interceptWidgetValue helper, add configurable:true
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a dropdown that filters LoRA dropdowns by base model type (SDXL,
Flux, Wan, etc.) using ComfyUI-Lora-Manager's API. If Lora Manager is
not installed, the filter widget is automatically hidden and dropdowns
show the full unfiltered list.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow users to control how each LoRA behaves in contested weight regions.
'low_conflict' applies only where the LoRA agrees with the majority sign,
'high_conflict' applies only where it disagrees. Defaults to 'all' (no
filtering) with zero overhead when unused.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Auto-strength now uses pairwise cosine similarity for exact vector-sum
energy normalization instead of assuming orthogonal LoRAs
- Save Merged LoRA defaults to ComfyUI loras folder; supports absolute paths
- Add JS extension for LoRA Stack (Dynamic) widget show/hide
- Fix LTX architecture detection for middle_block/mid_block keys
- Update banner SVG with new feature tags
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>