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
73f60740
Commit
73f60740
authored
Jan 28, 2023
by
comfyanonymous
Browse files
Slightly cleaner code.
parent
0108616b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
comfy/sd.py
comfy/sd.py
+4
-5
No files found.
comfy/sd.py
View file @
73f60740
...
...
@@ -32,11 +32,10 @@ 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
)
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
if
'cond_stage_model.transformer.text_model.embeddings.position_ids'
in
sd
:
ids
=
sd
[
'cond_stage_model.transformer.text_model.embeddings.position_ids'
]
if
ids
.
dtype
==
torch
.
float32
:
sd
[
'cond_stage_model.transformer.text_model.embeddings.position_ids'
]
=
ids
.
round
()
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