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
9f83b098
Commit
9f83b098
authored
Jun 22, 2023
by
comfyanonymous
Browse files
Don't merge weights when shapes don't match and print a warning.
parent
f87ec10a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
comfy/sd.py
comfy/sd.py
+5
-1
No files found.
comfy/sd.py
View file @
9f83b098
...
...
@@ -390,7 +390,11 @@ class ModelPatcher:
weight
*=
strength_model
if
len
(
v
)
==
1
:
weight
+=
alpha
*
(
v
[
0
]).
type
(
weight
.
dtype
).
to
(
weight
.
device
)
w1
=
v
[
0
]
if
w1
.
shape
!=
weight
.
shape
:
print
(
"WARNING SHAPE MISMATCH {} WEIGHT NOT MERGED {} != {}"
.
format
(
key
,
w1
.
shape
,
weight
.
shape
))
else
:
weight
+=
alpha
*
w1
.
type
(
weight
.
dtype
).
to
(
weight
.
device
)
elif
len
(
v
)
==
4
:
#lora/locon
mat1
=
v
[
0
]
mat2
=
v
[
1
]
...
...
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