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
fengzch-das
nunchaku
Commits
182c323c
Commit
182c323c
authored
Mar 18, 2025
by
Muyang Li
Committed by
Zhekai Zhang
Apr 01, 2025
Browse files
[minor] fix the lora scaling issue
parent
bf0813a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
nunchaku/lora/flux/comfyui_converter.py
nunchaku/lora/flux/comfyui_converter.py
+5
-0
No files found.
nunchaku/lora/flux/comfyui_converter.py
View file @
182c323c
...
@@ -50,6 +50,11 @@ def comfyui2diffusers(
...
@@ -50,6 +50,11 @@ def comfyui2diffusers(
new_k
=
new_k
.
replace
(
"_txt_mlp_0"
,
".ff_context.net.0.proj"
)
new_k
=
new_k
.
replace
(
"_txt_mlp_0"
,
".ff_context.net.0.proj"
)
new_k
=
new_k
.
replace
(
"_txt_mlp_2"
,
".ff_context.net.2"
)
new_k
=
new_k
.
replace
(
"_txt_mlp_2"
,
".ff_context.net.2"
)
new_k
=
new_k
.
replace
(
"_txt_mod_lin"
,
".norm1_context.linear"
)
new_k
=
new_k
.
replace
(
"_txt_mod_lin"
,
".norm1_context.linear"
)
if
"lora_down"
in
k
:
alpha
=
tensors
[
k
.
replace
(
"lora_down.weight"
,
"alpha"
)]
rank
=
v
.
shape
[
0
]
v
=
v
*
alpha
/
rank
max_rank
=
max
(
max_rank
,
rank
)
new_tensors
[
new_k
]
=
v
new_tensors
[
new_k
]
=
v
else
:
else
:
assert
"lora_unet_single_blocks"
in
k
assert
"lora_unet_single_blocks"
in
k
...
...
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