Skip to content

Commit 2614f12

Browse files
authored
Fix lora conversion function for ai-toolkit Qwen Image LoRAs
1 parent 9b721db commit 2614f12

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/diffusers/loaders/lora_conversion_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,6 +2129,10 @@ def _convert_non_diffusers_ltxv_lora_to_diffusers(state_dict, non_diffusers_pref
21292129

21302130

21312131
def _convert_non_diffusers_qwen_lora_to_diffusers(state_dict):
2132+
has_diffusion_model = any(k.startswith("diffusion_model." for k in state_dict)
2133+
if has_diffusion_model:
2134+
state_dict = {k.removeprefix("diffusion_model."): v for k, v in state_dict.items()}
2135+
21322136
has_lora_unet = any(k.startswith("lora_unet_") for k in state_dict)
21332137
if has_lora_unet:
21342138
state_dict = {k.removeprefix("lora_unet_"): v for k, v in state_dict.items()}

0 commit comments

Comments
 (0)