Fix potential issue with batch size and clip vision.

This commit is contained in:
comfyanonymous 2023-08-16 11:05:11 -04:00
parent 27b87c25a1
commit ae270f79bc

View File

@ -25,6 +25,8 @@ class ClipVisionModel():
def encode_image(self, image):
img = torch.clip((255. * image), 0, 255).round().int()
if len(img.shape) == 3:
img = [img]
inputs = self.processor(images=img, return_tensors="pt")
outputs = self.model(**inputs)
return outputs