ComfyUI Node
Model Diff to LoRA
Extracts a LoRA from the difference between two models. Use this to capture the combined effect of multiple chained LoRA operations into a single distributable LoRA file. Connect your original base model to 'model_before' and the final processed model (after V2 analyzers, selective loaders, etc.) to 'model_after'.
Model Diff to LoRA
- model_before
- model_after
- lora_path
- info
◄enabledtrue►
◄output_rank64►
◄output_path►
◄output_nameextracted_lora►
Categoryloaders/lora
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | BOOLEAN | true | Enable extraction. Auto-disables after successful save. |
| model_before | MODEL | Original base model (before LoRA chain) | |
| model_after | MODEL | Modified model (after LoRA chain) | |
| output_rank | INT | 644–256 | LoRA rank for SVD decomposition. Higher = more accurate but larger file. |
| output_path | STRING | Save directory. Leave empty for ComfyUI/output/extracted_loras. Remembers last used path. | |
| output_name | STRING | extracted_lora | Filename prefix (timestamp will be appended). Remembers last used name. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| lora_path | STRING | Full path to the saved LoRA file (for chaining to loaders) |
| info | STRING | Extraction summary with layer count, compression ratio, etc. |