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
0108616b
Commit
0108616b
authored
Jan 28, 2023
by
comfyanonymous
Browse files
Fix issue with some models.
parent
2973ff24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
comfy/sd.py
comfy/sd.py
+5
-2
No files found.
comfy/sd.py
View file @
0108616b
...
...
@@ -32,8 +32,11 @@ def load_model_from_config(config, ckpt, verbose=False, load_state_dict_to=[]):
y
=
x
.
replace
(
"cond_stage_model.transformer."
,
"cond_stage_model.transformer.text_model."
)
sd
[
y
]
=
sd
.
pop
(
x
)
if
'cond_stage_model.transformer.text_model.embeddings.position_ids'
in
sd
:
sd
[
'cond_stage_model.transformer.text_model.embeddings.position_ids'
]
=
sd
[
'cond_stage_model.transformer.text_model.embeddings.position_ids'
].
round
()
try
:
if
'cond_stage_model.transformer.text_model.embeddings.position_ids'
in
sd
:
sd
[
'cond_stage_model.transformer.text_model.embeddings.position_ids'
]
=
sd
[
'cond_stage_model.transformer.text_model.embeddings.position_ids'
].
round
()
except
:
pass
for
x
in
load_state_dict_to
:
x
.
load_state_dict
(
sd
,
strict
=
False
)
...
...
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