mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-30 02:47:24 +08:00
fix(LoadImage): ignore broken frames after first decoded image
This commit is contained in:
parent
d7111e426a
commit
db60a1e0e9
4
nodes.py
4
nodes.py
@ -1665,6 +1665,7 @@ class LoadImage:
|
|||||||
|
|
||||||
excluded_formats = ['MPO']
|
excluded_formats = ['MPO']
|
||||||
|
|
||||||
|
try:
|
||||||
for i in ImageSequence.Iterator(img):
|
for i in ImageSequence.Iterator(img):
|
||||||
i = node_helpers.pillow(ImageOps.exif_transpose, i)
|
i = node_helpers.pillow(ImageOps.exif_transpose, i)
|
||||||
|
|
||||||
@ -1691,6 +1692,9 @@ class LoadImage:
|
|||||||
mask = torch.zeros((64,64), dtype=torch.float32, device="cpu")
|
mask = torch.zeros((64,64), dtype=torch.float32, device="cpu")
|
||||||
output_images.append(image)
|
output_images.append(image)
|
||||||
output_masks.append(mask.unsqueeze(0))
|
output_masks.append(mask.unsqueeze(0))
|
||||||
|
except ValueError:
|
||||||
|
if img.format != "MPO" or len(output_images) == 0:
|
||||||
|
raise
|
||||||
|
|
||||||
if len(output_images) > 1 and img.format not in excluded_formats:
|
if len(output_images) > 1 and img.format not in excluded_formats:
|
||||||
output_image = torch.cat(output_images, dim=0)
|
output_image = torch.cat(output_images, dim=0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user