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
chenpangpang
ComfyUI
Commits
ec120001
"examples/dreambooth/test_dreambooth_flux.py" did not exist on "fdd003d8e2287e4dcdfc14a7d2fc9444e55c1904"
Commit
ec120001
authored
Nov 08, 2023
by
comfyanonymous
Browse files
Add support for full diff lora keys.
parent
064d7583
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
comfy/lora.py
comfy/lora.py
+12
-0
No files found.
comfy/lora.py
View file @
ec120001
...
...
@@ -131,6 +131,18 @@ def load_lora(lora, to_load):
loaded_keys
.
add
(
b_norm_name
)
patch_dict
[
"{}.bias"
.
format
(
to_load
[
x
][:
-
len
(
".weight"
)])]
=
(
b_norm
,)
diff_name
=
"{}.diff"
.
format
(
x
)
diff_weight
=
lora
.
get
(
diff_name
,
None
)
if
diff_weight
is
not
None
:
patch_dict
[
to_load
[
x
]]
=
(
diff_weight
,)
loaded_keys
.
add
(
diff_name
)
diff_bias_name
=
"{}.diff_b"
.
format
(
x
)
diff_bias
=
lora
.
get
(
diff_bias_name
,
None
)
if
diff_bias
is
not
None
:
patch_dict
[
"{}.bias"
.
format
(
to_load
[
x
][:
-
len
(
".weight"
)])]
=
(
diff_bias
,)
loaded_keys
.
add
(
diff_bias_name
)
for
x
in
lora
.
keys
():
if
x
not
in
loaded_keys
:
print
(
"lora key not loaded"
,
x
)
...
...
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