mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Fix clip vision issue with old transformers versions.
This commit is contained in:
parent
ae270f79bc
commit
58f0c616ed
@ -25,8 +25,7 @@ class ClipVisionModel():
|
||||
|
||||
def encode_image(self, image):
|
||||
img = torch.clip((255. * image), 0, 255).round().int()
|
||||
if len(img.shape) == 3:
|
||||
img = [img]
|
||||
img = list(map(lambda a: a, img))
|
||||
inputs = self.processor(images=img, return_tensors="pt")
|
||||
outputs = self.model(**inputs)
|
||||
return outputs
|
||||
|
Loading…
Reference in New Issue
Block a user