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
37a86e46
"doc/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "025692aa4d3c36974cf8af19ef6bc83ae042bd32"
Commit
37a86e46
authored
Feb 28, 2024
by
comfyanonymous
Browse files
Remove duplicate text_projection key from some saved models.
parent
8daedc5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
comfy/diffusers_convert.py
comfy/diffusers_convert.py
+3
-3
No files found.
comfy/diffusers_convert.py
View file @
37a86e46
...
@@ -240,9 +240,9 @@ def convert_text_enc_state_dict_v20(text_enc_dict, prefix=""):
...
@@ -240,9 +240,9 @@ def convert_text_enc_state_dict_v20(text_enc_dict, prefix=""):
text_proj
=
"transformer.text_projection.weight"
text_proj
=
"transformer.text_projection.weight"
if
k
.
endswith
(
text_proj
):
if
k
.
endswith
(
text_proj
):
new_state_dict
[
k
.
replace
(
text_proj
,
"text_projection"
)]
=
v
.
transpose
(
0
,
1
).
contiguous
()
new_state_dict
[
k
.
replace
(
text_proj
,
"text_projection"
)]
=
v
.
transpose
(
0
,
1
).
contiguous
()
else
:
relabelled_key
=
textenc_pattern
.
sub
(
lambda
m
:
protected
[
re
.
escape
(
m
.
group
(
0
))],
k
)
relabelled_key
=
textenc_pattern
.
sub
(
lambda
m
:
protected
[
re
.
escape
(
m
.
group
(
0
))],
k
)
new_state_dict
[
relabelled_key
]
=
v
new_state_dict
[
relabelled_key
]
=
v
for
k_pre
,
tensors
in
capture_qkv_weight
.
items
():
for
k_pre
,
tensors
in
capture_qkv_weight
.
items
():
if
None
in
tensors
:
if
None
in
tensors
:
...
...
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