mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-03-13 14:21:20 +00:00
Fix potential issue with batch size and clip vision.
This commit is contained in:
parent
27b87c25a1
commit
ae270f79bc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user