Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
dcfb18a2
Unverified
Commit
dcfb18a2
authored
Nov 04, 2025
by
Linoy Tsaban
Committed by
GitHub
Nov 04, 2025
Browse files
[LoRA] add support for more Qwen LoRAs (#12581)
* fix bug when offload and cache_latents both enabled * fix
parent
ac5a1e28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
src/diffusers/loaders/lora_conversion_utils.py
src/diffusers/loaders/lora_conversion_utils.py
+4
-0
src/diffusers/loaders/lora_pipeline.py
src/diffusers/loaders/lora_pipeline.py
+2
-1
No files found.
src/diffusers/loaders/lora_conversion_utils.py
View file @
dcfb18a2
...
@@ -2213,6 +2213,10 @@ def _convert_non_diffusers_qwen_lora_to_diffusers(state_dict):
...
@@ -2213,6 +2213,10 @@ def _convert_non_diffusers_qwen_lora_to_diffusers(state_dict):
state_dict
=
{
convert_key
(
k
):
v
for
k
,
v
in
state_dict
.
items
()}
state_dict
=
{
convert_key
(
k
):
v
for
k
,
v
in
state_dict
.
items
()}
has_default
=
any
(
"default."
in
k
for
k
in
state_dict
)
if
has_default
:
state_dict
=
{
k
.
replace
(
"default."
,
""
):
v
for
k
,
v
in
state_dict
.
items
()}
converted_state_dict
=
{}
converted_state_dict
=
{}
all_keys
=
list
(
state_dict
.
keys
())
all_keys
=
list
(
state_dict
.
keys
())
down_key
=
".lora_down.weight"
down_key
=
".lora_down.weight"
...
...
src/diffusers/loaders/lora_pipeline.py
View file @
dcfb18a2
...
@@ -4940,7 +4940,8 @@ class QwenImageLoraLoaderMixin(LoraBaseMixin):
...
@@ -4940,7 +4940,8 @@ class QwenImageLoraLoaderMixin(LoraBaseMixin):
has_alphas_in_sd
=
any
(
k
.
endswith
(
".alpha"
)
for
k
in
state_dict
)
has_alphas_in_sd
=
any
(
k
.
endswith
(
".alpha"
)
for
k
in
state_dict
)
has_lora_unet
=
any
(
k
.
startswith
(
"lora_unet_"
)
for
k
in
state_dict
)
has_lora_unet
=
any
(
k
.
startswith
(
"lora_unet_"
)
for
k
in
state_dict
)
has_diffusion_model
=
any
(
k
.
startswith
(
"diffusion_model."
)
for
k
in
state_dict
)
has_diffusion_model
=
any
(
k
.
startswith
(
"diffusion_model."
)
for
k
in
state_dict
)
if
has_alphas_in_sd
or
has_lora_unet
or
has_diffusion_model
:
has_default
=
any
(
"default."
in
k
for
k
in
state_dict
)
if
has_alphas_in_sd
or
has_lora_unet
or
has_diffusion_model
or
has_default
:
state_dict
=
_convert_non_diffusers_qwen_lora_to_diffusers
(
state_dict
)
state_dict
=
_convert_non_diffusers_qwen_lora_to_diffusers
(
state_dict
)
out
=
(
state_dict
,
metadata
)
if
return_lora_metadata
else
state_dict
out
=
(
state_dict
,
metadata
)
if
return_lora_metadata
else
state_dict
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment