Nodes/Mecha Merge Node Pack/Extract Lycoris Lora
ComfyUI Node

Extract Lycoris Lora

Extract a LoRA the LyCORIS way — same SVD, different key names

By ljleb·Created 3 years ago·Updated about a month ago· 101
Extract Lycoris Lora
  • base (delta)
  • rank (8)
  • use_approximate_basis (True)
  • approximate_basis_iters (2)
  • approximate_basis_seed (None)
  • recipe
merge_checkpointingfalse

This is the "one more checkbox" version of LoRA extraction. Extract Lycoris Lora does exactly what Extract Kohya Lora does - compress a merge delta down to lora_up/lora_down low-rank matrices via SVD - but it emits a LyCORIS-layout LoRA instead of a kohya one. Same rank, same approximate-SVD knobs, different key naming (lora_unet_* / lora_te_* prefixes, LyCORIS conventions). If you've never heard of LyCORIS, don't worry: it's the training library that grew out of LoRA and added a bunch of network types (LoHa, LoKr, Diag-OFT…) on top. Some loaders and some base-model ecosystems expect its naming, and this node exists so your extracted adapter lands on the right side of that fence.

Inputs

  • base (delta) - the difference to compress. From a Subtract between two checkpoints, or any delta recipe.
  • rank - default 8. Singular values kept. 8–32 is the practical SDXL range; higher rank = more fidelity, bigger file.
  • use_approximate_basis (True), approximate_basis_iters (2), approximate_basis_seed (None) - the randomized-SVD tuning. Approximate is way faster and near-invisible below a few iters; seed it if you want reproducible extractions.

Output: one recipe (MECHA_RECIPE) in LyCORIS LoRA space. Same usage as the kohya variant: into Add Difference as the b (delta) slot on a compatible base, or out through the serializer. It's a delta - don't hand it to Mecha Merger expecting a full model.

The merge_checkpointing toggle caches the branch on CPU in fp16 for repeated runs.

Kohya vs LyCORIS: does it actually matter?

Honestly, for SDXL, often no - both layouts load fine in ComfyUI's standard LoRA loader and most trainers. It matters in three situations: your downstream tooling (an external trainer, a script, another pack) explicitly checks the prefix; the base model's docs recommend one over the other; or you're matching the format the rest of your collection uses. The deeper point is the one the LoRA knowledge doc in our KB hammers: "LoRA" the name has outlived the format, and what people call a LoRA on modern bases is increasingly a different decomposition entirely. If you're extracting for a current architecture, check what your base's adapter ecosystem actually expects before picking a layout - LyCORIS-style tends to be the safer bet there.

Install & gotchas

ComfyUI Manager → search mecha → "Mecha Merge Node Pack", or:

cd ComfyUI/custom_nodes
git clone https://github.com/ljleb/comfy-mecha.git
pip install -r comfy-mecha/requirements.txt

Restart after. Dependency is sd-mecha==1.1.7, no model downloads.

Feed it a full weight where it wants a delta and you'll get nonsense compression, not an error. Extract from the full checkpoint difference, not from an already-extracted adapter, or you stack the loss twice.

Categorymecha

Inputs (6)

NameTypeDefaultDescription
base (delta)MECHA_RECIPE
rank (8)optMECHA_RECIPE8
use_approximate_basis (True)optMECHA_RECIPEtrue
approximate_basis_iters (2)optMECHA_RECIPE2
approximate_basis_seed (None)optMECHA_RECIPE
merge_checkpointingoptBOOLEANfalseSpeeds up an entire branch of a merge graph that does not change often in exchange of memory. - true: store the first output of this recipe node on cpu memory in fp16. On subsequent workflow executions, as long as the inputs do not change, the cached keys are returned after being cast to the original device and dtype. - false: do not store the output. The recipe and its inputs will re-execute on subsequent workflow executions. Note that the memory used to checkpoint the output is distinct from the cache feature. In general, you probably want to either use this *or* a cache unit, but not both at the same time because the memory adds up. The difference between merge checkpointing and cache is that merge checkpointing completely re-merges from scratch if any input changes. Merge checkpointing is also generally much faster than cache in the fast path.

Outputs (1)

NameTypeDescription
recipeMECHA_RECIPE