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
2973ff24
Commit
2973ff24
authored
Jan 28, 2023
by
comfyanonymous
Browse files
Round CLIP position ids to fix float issues in some checkpoints.
parent
e615d40c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
comfy/sd.py
comfy/sd.py
+3
-0
No files found.
comfy/sd.py
View file @
2973ff24
...
@@ -32,6 +32,9 @@ def load_model_from_config(config, ckpt, verbose=False, load_state_dict_to=[]):
...
@@ -32,6 +32,9 @@ 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."
)
y
=
x
.
replace
(
"cond_stage_model.transformer."
,
"cond_stage_model.transformer.text_model."
)
sd
[
y
]
=
sd
.
pop
(
x
)
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
()
for
x
in
load_state_dict_to
:
for
x
in
load_state_dict_to
:
x
.
load_state_dict
(
sd
,
strict
=
False
)
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