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
1718730e
Commit
1718730e
authored
Apr 04, 2023
by
comfyanonymous
Browse files
Ignore embeddings when sizes don't match and print a WARNING.
parent
5036fecb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
comfy/sd1_clip.py
comfy/sd1_clip.py
+6
-3
No files found.
comfy/sd1_clip.py
View file @
1718730e
...
...
@@ -74,9 +74,12 @@ class SD1ClipModel(torch.nn.Module, ClipTokenWeightEncoder):
if
isinstance
(
y
,
int
):
tokens_temp
+=
[
y
]
else
:
embedding_weights
+=
[
y
]
tokens_temp
+=
[
next_new_token
]
next_new_token
+=
1
if
y
.
shape
[
0
]
==
current_embeds
.
weight
.
shape
[
1
]:
embedding_weights
+=
[
y
]
tokens_temp
+=
[
next_new_token
]
next_new_token
+=
1
else
:
print
(
"WARNING: shape mismatch when trying to apply embedding, embedding will be ignored"
,
y
.
shape
[
0
],
current_embeds
.
weight
.
shape
[
1
])
out_tokens
+=
[
tokens_temp
]
if
len
(
embedding_weights
)
>
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