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
c7821444
Commit
c7821444
authored
Dec 27, 2023
by
comfyanonymous
Browse files
Fix clip vision lowvram mode not working.
parent
e478b179
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
comfy/clip_model.py
comfy/clip_model.py
+1
-1
No files found.
comfy/clip_model.py
View file @
c7821444
...
@@ -151,7 +151,7 @@ class CLIPVisionEmbeddings(torch.nn.Module):
...
@@ -151,7 +151,7 @@ class CLIPVisionEmbeddings(torch.nn.Module):
def
forward
(
self
,
pixel_values
):
def
forward
(
self
,
pixel_values
):
embeds
=
self
.
patch_embedding
(
pixel_values
).
flatten
(
2
).
transpose
(
1
,
2
)
embeds
=
self
.
patch_embedding
(
pixel_values
).
flatten
(
2
).
transpose
(
1
,
2
)
return
torch
.
cat
([
self
.
class_embedding
.
expand
(
pixel_values
.
shape
[
0
],
1
,
-
1
),
embeds
],
dim
=
1
)
+
self
.
position_embedding
.
weight
return
torch
.
cat
([
self
.
class_embedding
.
to
(
embeds
.
device
).
expand
(
pixel_values
.
shape
[
0
],
1
,
-
1
),
embeds
],
dim
=
1
)
+
self
.
position_embedding
.
weight
.
to
(
embeds
.
device
)
class
CLIPVision
(
torch
.
nn
.
Module
):
class
CLIPVision
(
torch
.
nn
.
Module
):
...
...
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