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
"test/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "39dca6ac4f60877e557264dfc72e9ee4b5c47b3a"
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():
precision_scope
=
lambda
a
,
b
:
contextlib
.
nullcontext
(
a
)
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
:
t
=
outputs
[
k
]
if
t
is
not
None
:
if
k
==
'hidden_states'
:
outputs
[
"penultimate_hidden_states"
]
=
t
[
-
2
].
cpu
()
else
:
outputs
[
k
]
=
t
.
cpu
()
return
outputs
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