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
1e0fcc9a
"tests/vscode:/vscode.git/clone" did not exist on "3b37fefee99425286984a9d5fa4f1850064d01eb"
Commit
1e0fcc9a
authored
Feb 27, 2024
by
comfyanonymous
Browse files
Make XL checkpoints save in a more standard format.
parent
b416be7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
comfy/supported_models.py
comfy/supported_models.py
+6
-2
No files found.
comfy/supported_models.py
View file @
1e0fcc9a
...
@@ -190,12 +190,16 @@ class SDXL(supported_models_base.BASE):
...
@@ -190,12 +190,16 @@ class SDXL(supported_models_base.BASE):
replace_prefix
=
{}
replace_prefix
=
{}
keys_to_replace
=
{}
keys_to_replace
=
{}
state_dict_g
=
diffusers_convert
.
convert_text_enc_state_dict_v20
(
state_dict
,
"clip_g"
)
state_dict_g
=
diffusers_convert
.
convert_text_enc_state_dict_v20
(
state_dict
,
"clip_g"
)
if
"clip_g.transformer.text_model.embeddings.position_ids"
in
state_dict_g
:
state_dict_g
.
pop
(
"clip_g.transformer.text_model.embeddings.position_ids"
)
for
k
in
state_dict
:
for
k
in
state_dict
:
if
k
.
startswith
(
"clip_l"
):
if
k
.
startswith
(
"clip_l"
):
state_dict_g
[
k
]
=
state_dict
[
k
]
state_dict_g
[
k
]
=
state_dict
[
k
]
state_dict_g
[
"clip_l.transformer.text_model.embeddings.position_ids"
]
=
torch
.
arange
(
77
).
expand
((
1
,
-
1
))
pop_keys
=
[
"clip_l.transformer.text_projection.weight"
,
"clip_l.logit_scale"
]
for
p
in
pop_keys
:
if
p
in
state_dict_g
:
state_dict_g
.
pop
(
p
)
replace_prefix
[
"clip_g"
]
=
"conditioner.embedders.1.model"
replace_prefix
[
"clip_g"
]
=
"conditioner.embedders.1.model"
replace_prefix
[
"clip_l"
]
=
"conditioner.embedders.0"
replace_prefix
[
"clip_l"
]
=
"conditioner.embedders.0"
state_dict_g
=
utils
.
state_dict_prefix_replace
(
state_dict_g
,
replace_prefix
)
state_dict_g
=
utils
.
state_dict_prefix_replace
(
state_dict_g
,
replace_prefix
)
...
...
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