Browse Source

Fix clip vision issue with old transformers versions.

pull/1249/head
comfyanonymous 1 year ago
parent
commit
58f0c616ed
  1. 3
      comfy/clip_vision.py

3
comfy/clip_vision.py

@ -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…
Cancel
Save