Nodes/Model Utility Toolkit/Lodestone LoRA Multi-Merge
ComfyUI Node

Lodestone LoRA Multi-Merge

The batch merge that normalizes each one first

By silveroxides·Created about a year ago·Updated a day ago· 16
Lodestone LoRA Multi-Merge
    • output_filename
    lora_count2
    lora_1
    lora_2
    lora_3None
    lora_4None
    lora_5None
    lora_6None
    lora_7None
    lora_8None
    calc_modesum
    mismatch_modeskip
    output_filenamelodestone_merged_multi_lora
    save_dtypebf16
    process_devicecuda
    exclude_patterns
    discard_patterns
    glob_patternsfalse

    The moment you're juggling more than three LoRAs, the sensible move stops being "stack them all in the graph" and becomes "bake the combination into a single file once." Lodestone LoRA Multi-Merge is the one node in the pack's Lodestone family that lets you go past three: it merges anywhere from 2 to 8 equal-strength LoRAs, expanding each into its full per-layer weight change and combining them with Frobenius-norm-aware math before writing one merged full-difference .safetensors into your loras folder.

    Mechanically it's the same honest approach as the fixed 2- and 3-input variants - no averaging of compressed low-rank factors. Each LoRA's real delta per layer is materialized (alpha normalized first), merged by the method you pick, and saved as canonical .diff tensors. The multi version just throws in a lora_count selector and seven slots, then applies the chosen method with every included LoRA treated as one equal-prior contribution.

    The inputs that matter

    • lora_count (default 2, range 2–8) - the one control that trips people up. It must equal the number of LoRA slots you actually filled. Set lora_count to 5 and leave lora_6 unselected and the node refuses to run with an "unselected input" error rather than quietly merging the wrong set.
    • lora_1 through lora_8 - lora_1 is mandatory and anchors the output layer set and metadata; lora_2 is always included too, and lora_3lora_8 default to None.
    • calc_mode (default sum) - with four or more LoRAs, blind sum is usually wrong: stacked deltas drift far from any single LoRA's intended strength. mean fixes the count scaling; slotnorm equalizes each input's Frobenius magnitude before averaging so a strong LoRA can't dominate; normmatch keeps the summed direction but rescales to a typical magnitude; slotnorm-normmatch does both. For big merges, treat the default as a starting point and expect to reach for the norm-aware modes.
    • mismatch_mode (default skip) - with many independently trained LoRAs, missing layers are common. skip keeps LoRA 1's version of the layer, zeros treats absent inputs as zero updates, error aborts.
    • output_filename - defaults to lodestone_merged_multi_lora; the .safetensors lands in models/loras.

    The only output is output_filename. This node exists to produce a file - run the workflow once, then the result sits in your loras folder like any other .safetensors, ready for the pack's own LoRA tooling or for LoRAMergeToModel if you'd rather bake it into a checkpoint.

    Where the batch merge earns its keep

    Memory is the pleasant surprise. It streams one logical layer at a time and writes each completed delta incrementally, so merging six LoRAs costs roughly the memory of one layer times contributors, not six full LoRAs in RAM. Each CUDA out-of-memory layer is retried on CPU, and the destination file is replaced only after a fully successful write - no half-written outputs when you walk away mid-merge.

    Two real caveats. First, the "equal-strength" framing is baked in: there are no per-input strength sliders, so if your inputs are wildly different in loudness, that's exactly what slotnorm (or slotnorm-normmatch) is for. Second, this stays in canonical plain-LoRA territory - DoRA-scale vectors and quantized/low-bit factors raise rather than merge, and every input needs matching layer keys where the merge matters.

    Installing it

    ComfyUI Manager: search Model Utility Toolkit. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/silveroxides/ComfyUI-ModelUtils
    

    Restart ComfyUI. No API keys, no model downloads - it reads LoRAs already sitting in your models/loras folder. Look for it under ModelUtils → LoRA → Merge → Lodestone, or search "Lodestone" and pick the Multi entry (the 2 and 3 variants are the same machinery with fixed slots). These mergers are recent additions to a pack that's still gathering community mileage, so sanity-check any surprising merge against a simple stack before you treat the baked file as gospel.

    CategoryModelUtils/LoRA/Merge/Lodestone

    Inputs (17)

    NameTypeDefaultDescription
    lora_countCOMBO2Number of consecutive LoRA selectors to merge, starting at LoRA 1. Every included LoRA has equal influence before the selected normalization method.
    lora_1COMBOFirst LoRA to merge. It supplies metadata, defines the output layer set, and anchors missing-layer handling.
    lora_2COMBOSecond equal-strength LoRA contribution. LoRA Count always includes this input.
    lora_3COMBONoneAdditional equal-strength LoRA contribution. Select a file for every input included by LoRA Count.
    lora_4COMBONoneAdditional equal-strength LoRA contribution. Select a file for every input included by LoRA Count.
    lora_5COMBONoneAdditional equal-strength LoRA contribution. Select a file for every input included by LoRA Count.
    lora_6COMBONoneAdditional equal-strength LoRA contribution. Select a file for every input included by LoRA Count.
    lora_7COMBONoneAdditional equal-strength LoRA contribution. Select a file for every input included by LoRA Count.
    lora_8COMBONoneAdditional equal-strength LoRA contribution. Select a file for every input included by LoRA Count.
    calc_modeCOMBOsumHow full LoRA weight changes are combined per layer. sum adds them; mean averages them; slotnorm equalizes each input's Frobenius magnitude before averaging; normmatch adds them and scales the result to a typical input magnitude; slotnorm-normmatch performs both normalization steps.
    mismatch_modeCOMBOskipWhat to do when a layer exists in LoRA 1 but is absent from another input. skip copies LoRA 1's layer unchanged; zeros treats each missing input as a zero update; error stops without replacing an existing output file.
    output_filenameSTRINGlodestone_merged_multi_loraName of the new .safetensors file. It is saved in ComfyUI's loras folder; omit the extension.
    save_dtypeCOMBObf16Precision used to save the expanded full-weight difference tensors. FP32 is largest and most precise; FP16 is smallest; BF16 has wider numeric range than FP16.
    process_deviceCOMBOcudaWhere each full layer is expanded and merged. CUDA is faster; if a layer runs out of VRAM, that layer is automatically retried on CPU.
    exclude_patternsSTRINGOptional layer-name patterns to copy from LoRA 1 instead of merging. Enter one pattern per line; useful for protecting specific blocks.
    discard_patternsSTRINGOptional layer-name patterns to leave out of the saved LoRA completely. Enter one pattern per line; discarded layers cannot affect the model.
    glob_patternsBOOLEANfalseChoose filter syntax. Off uses regular expressions; on uses shell-style globs where * matches any text and ? matches one character.

    Outputs (1)

    NameTypeDescription
    output_filename*