Nodes/Ray's Orenchi/🧰 Ray's Model Tools: LoRA Extract
ComfyUI Node

🧰 Ray's Model Tools: LoRA Extract

Extract a low-rank approximation of finetuned minus base. Supports Linear and convolution weights. Alpha=0 uses each layer's actual rank. Error is the SVD truncation error before output rounding.

By MutantSparrowΒ·Created 4 months agoΒ·Updated 3 days agoΒ· 1
🧰 Ray's Model Tools: LoRA Extract
  • finetuned_model
  • base_model
  • finetuned_clip
  • base_clip
  • finetuned_data
  • base_data
  • saved_path
  • lora_data
  • report
β—„filename_prefixmodel_tools/Ray_Extracted_LoRAβ–Ί
β—„rank16β–Ί
β—„alpha0β–Ί
β—„componentsdiffusionβ–Ί
β—„weight_formatbf16β–Ί
β—„include_embeddingsfalseβ–Ί
β—„finetuned_pathβ–Ί
β—„base_pathβ–Ί
β—„output_pathβ–Ί
CategoryπŸ‘‘ Ray/🧰 Model Tools

Inputs (15)

NameTypeDefaultDescription
filename_prefixSTRINGmodel_tools/Ray_Extracted_LoRAName or prefix for automatic output under ComfyUI's output folder. An explicit Output file takes precedence when available.
rankINT161–4096Maximum low-rank dimension retained per extracted LoRA tensor. Higher ranks preserve more of the difference and produce larger adapters.
alphaFLOAT00–4096LoRA alpha written into the adapter scaling metadata. Zero uses the selected rank.
componentsCOMBOdiffusionChoose diffusion weights, diffusion plus text encoders, text encoders only, or all supported components. Unselected components follow the operation's preservation rules.
weight_formatCOMBObf16Storage precision or quantization for the result. Auto/Preserve keeps the source representation where supported. Converting to higher precision cannot recover information already lost.
include_embeddingsBOOLEANfalseInclude supported embedding changes in the extracted adapter in addition to the selected low-rank weight differences.
finetuned_modeloptMODELFine-tuned live model from which to extract changes relative to the base model. Connected effective weights take precedence over file/data sources.
base_modeloptMODELCompatible original live model used as the reference for extraction. Use the actual training base for meaningful differences.
finetuned_clipoptCLIPFine-tuned text encoder for extraction when the selected component scope includes text-encoder weights.
base_clipoptCLIPCompatible base text encoder paired with the fine-tuned text encoder for extraction.
finetuned_dataoptRAY_MODEL_DATAModel-data handle supplying fine-tuned weights when no fine-tuned live model is connected.
base_dataoptRAY_MODEL_DATAModel-data handle supplying base weights when no base live model is connected.
finetuned_pathoptSTRINGFine-tuned checkpoint file used when its live-model and data inputs are unconnected.
base_pathoptSTRINGCompatible base checkpoint file used when its live-model and data inputs are unconnected.
output_pathoptSTRINGOptional explicit destination file on the ComfyUI server. Leave blank for automatic output naming; the extension must match the selected output mode.

Outputs (3)

NameTypeDescription
saved_pathSTRINGActual server path of the completed output file. Emitted only after a successful save.
lora_dataRAY_MODEL_DATAModel Tools data handle referring to the saved extracted LoRA adapter.
reportSTRINGReadable inspection or operation report, including compatibility, format, processing, and saved-result information relevant to this operation.