Nodes/CRT-Nodes/Magic Save Merged LoRA (CRT)
ComfyUI Node

Magic Save Merged LoRA (CRT)

Turn a merged LoRA into a file you can actually ship

By PGCRT·Created 2 years ago·Updated a day ago· 132
Magic Save Merged LoRA (CRT)
  • merged_lora
  • filepath
filenamemerged_lora
keep_blocks
save_to
rank64
dynamic_methoddisabled
dynamic_param0.99

Merging LoRAs is easy; keeping the result is the awkward part. Magic Save Merged LoRA (CRT) is the save button for the merged output of the pack's Magic LoRA Loader - it takes the in-memory merged deltas and writes them to a real .safetensors file on disk, with two genuinely useful options: slice the merge down to specific blocks, and compress it via SVD to a chosen rank.

The important thing to know up front: this node does nothing on its own. It consumes the MERGED_LORA output that only the Magic LoRA Loader produces, so it's the second half of that pair. If you're not using Magic LoRA Loader, this node isn't for you.

How it works

The merged result from Magic LoRA Loader is a dict of weight deltas - the difference the LoRA wants to apply, kept separate from the base weights. This node serializes that:

  • keep_blocks filters the deltas by block index before saving (comma-separated, ranges supported: 0-13,16,17,26,27). Empty = keep everything. If you only want a specific layer range - say the attention blocks that carry a character's identity - this shrinks the file and the concept.
  • rank is the compression control. At 0, it writes a lossless diff format: every delta tensor saved as-is in float16. Larger file, exact result. At 64 (the default), it runs per-tensor SVD and writes lora_up, lora_down, and alpha tensors - the standard LoRA file layout, much smaller, at the cost of a low-rank approximation.
  • save_to chooses loras folder (so it shows up in every LoRA loader) or output folder (the ComfyUI output dir).

The SVD path is streamed: each tensor is pushed to the GPU, decomposed, and moved back to CPU before the next one, which keeps VRAM bounded even on a big merge. It's also an output node that always re-runs, so you won't get stale "filepath" results from cache.

Inputs

  • merged_lora - the MERGED_LORA from Magic LoRA Loader.
  • filename - output name (no extension needed).
  • keep_blocks - block filter; empty for all.
  • save_to - loras folder or output folder.
  • rank - 0 = lossless diff; 1–512 = SVD-compressed LoRA. This is the one you'll tune.

Output is a single filepath string telling you where it landed.

The tradeoff worth knowing

From the LoRA playbook: rank is capacity. Save at too low a rank and the merged behavior thins out - it's a compression, not a copy. Rank 64 is a sane default for SDXL-era merges; post-Flux architectures want more headroom, so lean higher (or go lossless at rank 0) when the result feels weak. The flip side: lossless diff files are big. If you're sharing a merge publicly, compress; if you're archiving your own work, lossless.

Gotchas

  • It's conditionally registered. The node only appears if the Magic LoRA Loader import succeeds at load time. If it's missing from your menu, the pack silently skipped it - check the console on startup.
  • Nothing in → nothing out: it returns an empty filepath and logs a warning if there's no merged data, rather than crashing.
  • Saved LoRAs are full models in the loras folder - remember to set a filename that means something before a batch run overwrites it.

Install is the shared pack story: ComfyUI Manager → search CRT-Nodes → install and restart, or clone into custom_nodes. It's a heavy suite, but it degrades gracefully - failing optional nodes don't take down the UI.

CategoryCRT/LoRA

Inputs (7)

NameTypeDefaultDescription
merged_loraMERGED_LORA
filenameSTRINGmerged_lora
keep_blocksSTRINGComma-separated block indexes to keep in the saved LoRA. Empty = save all blocks. Supports ranges like 0-13,16,17,26,27.
save_toCOMBO2 options: loras folder, output folder
rankINT640–512SVD rank for compression. 0 = lossless diff format (larger file). >0 = LoRA format with SVD at this rank. Acts as max rank per layer when dynamic_method is enabled.
dynamic_methodCOMBOdisabledDynamic per-layer rank selection. sv_fro: smallest rank keeping dynamic_param of the Frobenius norm. sv_ratio: keep singular values above max(S)/dynamic_param.
dynamic_paramFLOAT0.990–1000Target for dynamic_method. sv_fro: kept Frobenius norm ratio per layer, e.g. 0.99. sv_ratio: keep singular values above max(S)/dynamic_param, e.g. 10-100. Ignored when dynamic_method is disabled.

Outputs (1)

NameTypeDescription
filepathSTRING