Extract Flux LoRA
Turn a full fine-tune into a shippable LoRA
- output_path
Say you did a full Flux fine-tune - a multi-gigabyte checkpoint - and now you want to hand it out as a tidy little LoRA instead. ExtractFluxLoRA does exactly that. It takes your original base model and your fine-tuned model, computes the difference between them, and compresses that difference into a LoRA file. Same learned change, a fraction of the size.
This is the "middle ground" of distribution. Full fine-tuning gives the best quality but ships as gigabytes; a LoRA ships as megabytes but is trained as an approximation from the start. Extraction lets you train the high-quality way and distribute the compact way - you keep the fine-tune's quality baked into a LoRA-shaped diff.
How it works
The node diffs two models and outputs an output_path (STRING) pointing at the extracted LoRA. The inputs that matter:
original_model- the base Flux model you started from (a dropdown of your model files).finetuned_model- your fine-tuned result. The extraction isfinetuned − original.dim(default 4) - the rank of the extracted LoRA. Higher captures more of the fine-tune's changes at a bigger file size; lower is more compressed and lossier. This is the main quality/size dial.clamp_quantile(default 0.99) - clamps outlier values during the singular-value decomposition, which keeps the extraction stable. The default is sensible; leave it unless you know why you're changing it.save_dtype(default bf16) - precision of the output file.load_device/store_device- where the heavy math runs (cudato compute) and where results are held (cputo spare VRAM). The defaults balance speed and memory.
When you'd use it
Two honest cases. One: you fine-tuned and want a distributable LoRA without retraining. Two: you want to convert a big checkpoint you got elsewhere into a LoRA you can stack at inference. If you only ever trained a LoRA to begin with, you don't need this node at all - you already have the LoRA.
Installing the pack
ComfyUI Manager: search ComfyUI Flux Trainer, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-FluxTrainer
pip install -r ComfyUI-FluxTrainer/requirements.txt
Torch 2.4.0+ recommended, plus kijai's ComfyUI-KJNodes for the example workflows.
Common issues
dim is a quality/size tradeoff, not free. Extraction into too low a rank loses detail from the fine-tune; too high and you've made a bloated LoRA that barely beats the checkpoint on size. Start around the default and raise dim if the extracted LoRA doesn't reproduce the fine-tune closely enough.
Mismatched models give garbage. The two models must be the same architecture and lineage - a Flux fine-tune against a Flux base. Diffing incompatible models produces a meaningless LoRA.
It's not lossless. An extracted LoRA is an approximation of the full fine-tune, not an identical copy. For the absolute best quality you'd distribute the checkpoint itself; extraction is the practical compromise when size matters.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| original_model | COMBO | 0 options: | |
| finetuned_model | COMBO | 0 options: | |
| output_path | STRING | /tmp/ComfyUI/models/loras/Flux | — |
| dim | INT | 42–1024 | LoRA rank |
| save_dtype | COMBO | bf16 | the dtype to save the LoRA as |
| load_device | COMBO | cuda | the device to load the model to |
| store_device | COMBO | cpu | the device to store the LoRA as |
| clamp_quantile | FLOAT | 0.990–1 | clamp quantile |
| metadata | BOOLEAN | true | build metadata |
| mem_eff_safe_open | BOOLEAN | false | memory efficient loading |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_path | STRING | — |