Adds module-level _extract_lora_svd() that SVD-decomposes a weight
delta into (lora_up, lora_down, alpha), supporting fixed-rank and
auto-rank (energy threshold) modes with a singular value noise floor.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds TestExtractLoRAFromDelta test class and _load_module() helper
to support TDD for the upcoming LoRAExtractFromModel node.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add _execute_merge_tree, _resolve_tree_to_stack, and
_model_to_virtual_lora methods to LoRAOptimizer. Modify optimize_merge
to detect formula metadata in the stack and delegate to the tree
executor for hierarchical sub-group merging. Add safety filter in
_normalize_stack to strip formula metadata entries.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- SaveMergedLoRA now writes safetensors metadata (source LoRAs, merge
settings, architecture) plus optional user prompt/description
- SaveTunerData accepts optional prompt/description, embeds in JSON
- LoadTunerData outputs prompt, description, and metadata_info strings
- AutoTuner records source_loras in tuner_data for provenance
- New LoRAMetadataReader passthrough node extracts metadata from any
safetensors LoRA in a stack (prompt, description, merge info)
- LoRAStack attaches file metadata at load time; _normalize_stack
preserves it through both tuple and dict paths
- Graceful degradation: missing metadata produces empty strings
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>
Create a new LoRAMergeSettings node holding the 6 shared parameters
(normalize_keys, architecture_preset, auto_strength_floor,
decision_smoothing, vram_budget, cache_patches) that were duplicated
across LoRAOptimizerSettings and LoRAAutoTunerSettings.
Both mode nodes now accept an optional MERGE_SETTINGS input and fall
back to identical defaults when unconnected — output dicts are unchanged
so execute_simple needs zero modifications.
Also fixes:
- v1 scoring: de-dent composite_score recomputation so it always runs
under scoring_formula=="v1", not only when sparsification is enabled
- RAM leak: clear _autotuner_delegate caches on model change and when
switching between advanced/autotuner modes in LoRAOptimizerSimple
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add two pure-data nodes (LoRAOptimizerSettings, LoRAAutoTunerSettings)
that output OPTIMIZER_SETTINGS dicts. Connecting either to the Simple
node's new 'settings' input transforms it into the Advanced Optimizer
or AutoTuner respectively, so users never need to swap node types.
Settings take priority over tuner_data and defaults. The AutoTuner
delegate is persisted on the Simple instance so cache_patches works
across re-executions. Unknown mode values raise ValueError.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix two runtime bugs where orphaned "" arguments were passed to
_compute_cache_key (TypeError from extra positional arg). Also clean
up stale importance_mode, activation_ratio, and per_lora_activation_sq
references.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all CALIBRATION_DATA infrastructure (SaveCalibrationData,
LoadCalibrationData nodes, activation importance scoring, calibration
hash in cache keys). This duplicates tuner_data functionality and
adds unnecessary complexity.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>