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
38b7ac6e
Commit
38b7ac6e
authored
Feb 13, 2024
by
comfyanonymous
Browse files
Don't init the CLIP model when the checkpoint has no CLIP weights.
parent
0c9bc197
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
comfy/sd.py
comfy/sd.py
+6
-3
No files found.
comfy/sd.py
View file @
38b7ac6e
...
...
@@ -470,10 +470,13 @@ def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, o
w
=
WeightsLoader
()
clip_target
=
model_config
.
clip_target
()
if
clip_target
is
not
None
:
clip
=
CLIP
(
clip_target
,
embedding_directory
=
embedding_directory
)
w
.
cond_stage_model
=
clip
.
cond_stage_model
sd
=
model_config
.
process_clip_state_dict
(
sd
)
load_model_weights
(
w
,
sd
)
if
any
(
k
.
startswith
(
'cond_stage_model.'
)
for
k
in
sd
):
clip
=
CLIP
(
clip_target
,
embedding_directory
=
embedding_directory
)
w
.
cond_stage_model
=
clip
.
cond_stage_model
load_model_weights
(
w
,
sd
)
else
:
print
(
"no CLIP/text encoder weights in checkpoint, the text encoder model will not be loaded."
)
left_over
=
sd
.
keys
()
if
len
(
left_over
)
>
0
:
...
...
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