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
6ad0a6d7
"ppocr/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "2e67b9ae8e47f1f98a802ad668302114e578247c"
Commit
6ad0a6d7
authored
Jul 09, 2023
by
comfyanonymous
Browse files
Don't patch weights when multiplier is zero.
parent
af15add9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
comfy/sd.py
comfy/sd.py
+5
-4
No files found.
comfy/sd.py
View file @
6ad0a6d7
...
@@ -359,10 +359,11 @@ class ModelPatcher:
...
@@ -359,10 +359,11 @@ class ModelPatcher:
if
len
(
v
)
==
1
:
if
len
(
v
)
==
1
:
w1
=
v
[
0
]
w1
=
v
[
0
]
if
w1
.
shape
!=
weight
.
shape
:
if
alpha
!=
0.0
:
print
(
"WARNING SHAPE MISMATCH {} WEIGHT NOT MERGED {} != {}"
.
format
(
key
,
w1
.
shape
,
weight
.
shape
))
if
w1
.
shape
!=
weight
.
shape
:
else
:
print
(
"WARNING SHAPE MISMATCH {} WEIGHT NOT MERGED {} != {}"
.
format
(
key
,
w1
.
shape
,
weight
.
shape
))
weight
+=
alpha
*
w1
.
type
(
weight
.
dtype
).
to
(
weight
.
device
)
else
:
weight
+=
alpha
*
w1
.
type
(
weight
.
dtype
).
to
(
weight
.
device
)
elif
len
(
v
)
==
4
:
#lora/locon
elif
len
(
v
)
==
4
:
#lora/locon
mat1
=
v
[
0
]
mat1
=
v
[
0
]
mat2
=
v
[
1
]
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