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
e85be36b
"git@developer.sourcefind.cn:modelzoo/latte_pytorch.git" did not exist on "5f9377aaa53817a1053970ce8f088df9643c1db5"
Commit
e85be36b
authored
Sep 08, 2023
by
comfyanonymous
Browse files
Add a penultimate_hidden_states to the clip vision output.
parent
10de64af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
comfy/clip_vision.py
comfy/clip_vision.py
+6
-2
No files found.
comfy/clip_vision.py
View file @
e85be36b
...
@@ -49,12 +49,16 @@ class ClipVisionModel():
...
@@ -49,12 +49,16 @@ class ClipVisionModel():
precision_scope
=
lambda
a
,
b
:
contextlib
.
nullcontext
(
a
)
precision_scope
=
lambda
a
,
b
:
contextlib
.
nullcontext
(
a
)
with
precision_scope
(
comfy
.
model_management
.
get_autocast_device
(
self
.
load_device
),
torch
.
float32
):
with
precision_scope
(
comfy
.
model_management
.
get_autocast_device
(
self
.
load_device
),
torch
.
float32
):
outputs
=
self
.
model
(
pixel_values
=
pixel_values
)
outputs
=
self
.
model
(
pixel_values
=
pixel_values
,
output_hidden_states
=
True
)
for
k
in
outputs
:
for
k
in
outputs
:
t
=
outputs
[
k
]
t
=
outputs
[
k
]
if
t
is
not
None
:
if
t
is
not
None
:
if
k
==
'hidden_states'
:
outputs
[
"penultimate_hidden_states"
]
=
t
[
-
2
].
cpu
()
else
:
outputs
[
k
]
=
t
.
cpu
()
outputs
[
k
]
=
t
.
cpu
()
return
outputs
return
outputs
def
convert_to_transformers
(
sd
,
prefix
):
def
convert_to_transformers
(
sd
,
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