ComfyUI Node
Rebase LoRA From Finetune
Applies a source LoRA to the base MODEL/CLIP, subtracts the finetuned MODEL/CLIP, then writes a new LoRA/patch file relative to the finetuned weights.
Rebase LoRA From Finetune
- base_model
- finetuned_model
- base_clip
- finetuned_clip
- saved_lora
- report
◄base_lora_name▾►
◄save_relpathrebased/rebased_lora►
◄rank16►
◄layer_scope▾►
◄rank_mode▾►
◄output_mode▾►
◄strength_model1.00►
◄strength_clip1.00►
◄save_dtype▾►
◄bias_difftrue►
◄clamp_quantile0.990►
◄include_cliptrue►
◄compute_deviceauto►
◄svd_modeauto►
◄cuda_svd_driverauto►
◄lowrank_oversample16►
◄lowrank_niter2►
Categorymodel_merging/lora
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| base_model | MODEL | — | |
| finetuned_model | MODEL | — | |
| base_lora_name | COMBO | The source LoRA trained on top of the base model. | |
| save_relpath | STRING | rebased/rebased_lora | Relative path inside the ComfyUI loras folder. .safetensors is optional. |
| rank | INT | 161–4096 | — |
| layer_scope | COMBO | original_lora_only keeps only layers touched by the source LoRA. all_compatible_weights tries to recreate the full target delta. | |
| rank_mode | COMBO | Reuse the input LoRA layer rank when possible, or force one fixed rank for every extracted layer. | |
| output_mode | COMBO | standard writes LoRA factors where possible. full_diff_patch writes exact diff tensors instead. | |
| strength_model | FLOAT | 1.00-10–10 | — |
| strength_clip | FLOAT | 1.00-10–10 | — |
| save_dtype | COMBO | Tensor dtype used in the written safetensors file. | |
| bias_diff | BOOLEAN | true | When enabled, bias deltas are written as .diff_b patches. |
| clamp_quantile | FLOAT | 0.9900–1 | Symmetric clamp used before writing LoRA factors. Set to 0 or 1 to disable. |
| include_clip | BOOLEAN | true | Also extract text-encoder deltas when clip inputs are connected. |
| compute_device | COMBO | auto | Where to run subtraction and SVD. GPU mainly helps standard LoRA extraction; full_diff_patch is usually fine on CPU. |
| svd_mode | COMBO | auto | auto uses full SVD for most layers and randomized low-rank SVD only when the requested rank is much smaller than the matrix. |
| cuda_svd_driver | COMBO | auto | CUDA-only torch.linalg.svd driver. Leave on auto unless you are tuning speed/accuracy. |
| lowrank_oversample | INT | 160–512 | Extra rank budget used by randomized low-rank SVD in auto/lowrank mode. |
| lowrank_niter | INT | 20–16 | Power iterations for randomized low-rank SVD. Higher is slower but usually more accurate. |
| base_clipopt | CLIP | — | |
| finetuned_clipopt | CLIP | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| saved_lora | STRING | — |
| report | STRING | — |