Support properly loading images with mode I.

This commit is contained in:
comfyanonymous 2024-01-08 03:46:36 -05:00
parent c6951548cf
commit 6a10640f0d
1 changed files with 2 additions and 0 deletions

View File

@ -1415,6 +1415,8 @@ class LoadImage:
output_masks = []
for i in ImageSequence.Iterator(img):
i = ImageOps.exif_transpose(i)
if i.mode == 'I':
i = i.point(lambda i: i * (1 / 255))
image = i.convert("RGB")
image = np.array(image).astype(np.float32) / 255.0
image = torch.from_numpy(image)[None,]