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
46dc050c
"build/cmake.sh" did not exist on "84b36bc18dd605d2e5f6393f6ede413eaa7214ed"
Commit
46dc050c
authored
Jul 12, 2023
by
comfyanonymous
Browse files
Fix potential tensors being on different devices issues.
parent
90aa5970
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
comfy/sd1_clip.py
comfy/sd1_clip.py
+2
-2
No files found.
comfy/sd1_clip.py
View file @
46dc050c
...
...
@@ -32,7 +32,7 @@ class ClipTokenWeightEncoder:
output
.
append
(
z
)
if
(
len
(
output
)
==
0
):
return
z_empty
,
first_pooled
return
z_empty
.
cpu
()
,
first_pooled
.
cpu
()
return
torch
.
cat
(
output
,
dim
=-
2
).
cpu
(),
first_pooled
.
cpu
()
class
SD1ClipModel
(
torch
.
nn
.
Module
,
ClipTokenWeightEncoder
):
...
...
@@ -139,7 +139,7 @@ class SD1ClipModel(torch.nn.Module, ClipTokenWeightEncoder):
pooled_output
=
outputs
.
pooler_output
if
self
.
text_projection
is
not
None
:
pooled_output
=
pooled_output
@
self
.
text_projection
pooled_output
=
pooled_output
.
to
(
self
.
text_projection
.
device
)
@
self
.
text_projection
return
z
.
float
(),
pooled_output
.
float
()
def
encode
(
self
,
tokens
):
...
...
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