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.
π§° 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)
| Name | Type | Default | Description |
|---|---|---|---|
| filename_prefix | STRING | model_tools/Ray_Extracted_LoRA | Name or prefix for automatic output under ComfyUI's output folder. An explicit Output file takes precedence when available. |
| rank | INT | 161β4096 | Maximum low-rank dimension retained per extracted LoRA tensor. Higher ranks preserve more of the difference and produce larger adapters. |
| alpha | FLOAT | 00β4096 | LoRA alpha written into the adapter scaling metadata. Zero uses the selected rank. |
| components | COMBO | diffusion | Choose diffusion weights, diffusion plus text encoders, text encoders only, or all supported components. Unselected components follow the operation's preservation rules. |
| weight_format | COMBO | bf16 | Storage precision or quantization for the result. Auto/Preserve keeps the source representation where supported. Converting to higher precision cannot recover information already lost. |
| include_embeddings | BOOLEAN | false | Include supported embedding changes in the extracted adapter in addition to the selected low-rank weight differences. |
| finetuned_modelopt | MODEL | Fine-tuned live model from which to extract changes relative to the base model. Connected effective weights take precedence over file/data sources. | |
| base_modelopt | MODEL | Compatible original live model used as the reference for extraction. Use the actual training base for meaningful differences. | |
| finetuned_clipopt | CLIP | Fine-tuned text encoder for extraction when the selected component scope includes text-encoder weights. | |
| base_clipopt | CLIP | Compatible base text encoder paired with the fine-tuned text encoder for extraction. | |
| finetuned_dataopt | RAY_MODEL_DATA | Model-data handle supplying fine-tuned weights when no fine-tuned live model is connected. | |
| base_dataopt | RAY_MODEL_DATA | Model-data handle supplying base weights when no base live model is connected. | |
| finetuned_pathopt | STRING | Fine-tuned checkpoint file used when its live-model and data inputs are unconnected. | |
| base_pathopt | STRING | Compatible base checkpoint file used when its live-model and data inputs are unconnected. | |
| output_pathopt | STRING | Optional explicit destination file on the ComfyUI server. Leave blank for automatic output naming; the extension must match the selected output mode. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| saved_path | STRING | Actual server path of the completed output file. Emitted only after a successful save. |
| lora_data | RAY_MODEL_DATA | Model Tools data handle referring to the saved extracted LoRA adapter. |
| report | STRING | Readable inspection or operation report, including compatibility, format, processing, and saved-result information relevant to this operation. |