kohya-ss / kohya-ss/sd-scripts
flux_extract_lora.py need update for extracting FLUX SRPO model
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
I hope you can fix this @kohya-ss
```
Microsoft Windows [Version 10.0.26200.6901]
(c) Microsoft Corporation. All rights reserved.
F:\Kohya_FLUX_DreamBooth_LoRA_v31\kohya_ss\sd-scripts>git status
On branch sd3
Your branch is up to date with 'origin/sd3'.
nothing to commit, working tree clean
F:\Kohya_FLUX_DreamBooth_LoRA_v31\kohya_ss\sd-scripts>git log -1
commit 5e366acda4789af215a820b1ac866c214f6c9f34 (HEAD -> sd3, origin/sd3)
Merge: 5462a6b e64dc05
Author: Kohya S. <52813779+kohya-ss@users.noreply.github.com>
Date: Wed Oct 1 21:03:12 2025 +0900
Merge pull request #2003 from laolongboy/sd3-dev
Fix missing parameters in model conversion script
F:\Kohya_FLUX_DreamBooth_LoRA_v31\kohya_ss\sd-scripts>
```
Currently below command working.
```
23:47:34-475360 INFO Executing command: F:\Kohya_FLUX_DreamBooth_LoRA_v31\kohya_ss\venv\Scripts\python.exe
F:/Kohya_FLUX_DreamBooth_LoRA_v31/kohya_ss/sd-scripts/networks/flux_extract_lora.py --model_org
F:/SwarmUI_Model_Downloader_v81/SwarmUI/Models/diffusion_models/FLUX_Dev.safetensors
--model_tuned
F:/SwarmUI_Model_Downloader_v81/SwarmUI/Models/diffusion_models/256_img_BS_1-000070.safetensors
--save_to
F:/SwarmUI_Model_Downloader_v81/SwarmUI/Models/Lora/FLUX_SRPO_LoRA_Extract.safetensors --dim
640 --device cpu --clamp_quantile 1 --save_precision bf16
2%|█▌ | 6/304 [00:31<26:59, 5.43s/it]
```
But when I provide FLUX SRPO model as a base model and fine tuned model nothing happens it saves 1kb file
```
23:43:46-497943 INFO Executing command: F:\Kohya_FLUX_DreamBooth_LoRA_v31\kohya_ss\venv\Scripts\python.exe
F:/Kohya_FLUX_DreamBooth_LoRA_v31/kohya_ss/sd-scripts/networks/flux_extract_lora.py --model_org
F:/SwarmUI_Model_Downloader_v81/SwarmUI/Models/diffusion_models/FLUX-SRPO-bf16.safetensors
--model_tuned
F:/SwarmUI_Model_Downloader_v81/SwarmUI/Models/diffusion_models/FLUX_SRPO_DreamBooth.safetensor
s --save_to
F:/SwarmUI_Model_Downloader_v81/SwarmUI/Models/Lora/FLUX_SRPO_LoRA_Extract.safetensors --dim
640 --device cpu --clamp_quantile 1 --save_precision bf16
0it [00:00, ?it/s]
2025-10-22 23:43:49 INFO LoRA weights saved to flux_extract_lora.py:149
F:/SwarmUI_Model_Downloader_v81/SwarmUI/Models/Lora/FLUX_SRPO_LoRA
_Extract.safetensors
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The affected entry point is networks/flux_extract_lora.py; first reproduce the two commands and compare the FLUX and FLUX-SRPO outputs, especially the 0-iteration run. Done means the script extracts a non-empty LoRA file from the FLUX SRPO base and fine-tuned models while preserving the existing working FLUX behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100