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
58f0c616
"...composable_kernel_onnx.git" did not exist on "9d99a5807298c3f263d39a08328c3c68c930a900"
Commit
58f0c616
authored
Aug 16, 2023
by
comfyanonymous
Browse files
Fix clip vision issue with old transformers versions.
parent
ae270f79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
comfy/clip_vision.py
comfy/clip_vision.py
+1
-2
No files found.
comfy/clip_vision.py
View file @
58f0c616
...
@@ -25,8 +25,7 @@ class ClipVisionModel():
...
@@ -25,8 +25,7 @@ class ClipVisionModel():
def
encode_image
(
self
,
image
):
def
encode_image
(
self
,
image
):
img
=
torch
.
clip
((
255.
*
image
),
0
,
255
).
round
().
int
()
img
=
torch
.
clip
((
255.
*
image
),
0
,
255
).
round
().
int
()
if
len
(
img
.
shape
)
==
3
:
img
=
list
(
map
(
lambda
a
:
a
,
img
))
img
=
[
img
]
inputs
=
self
.
processor
(
images
=
img
,
return_tensors
=
"pt"
)
inputs
=
self
.
processor
(
images
=
img
,
return_tensors
=
"pt"
)
outputs
=
self
.
model
(
**
inputs
)
outputs
=
self
.
model
(
**
inputs
)
return
outputs
return
outputs
...
...
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