diff --git a/nodes.py b/nodes.py index 488afd57702..bc8148d7e7d 100644 --- a/nodes.py +++ b/nodes.py @@ -1461,12 +1461,22 @@ def load_image(self, image): output_images = [] output_masks = [] + w, h = None, None + for i in ImageSequence.Iterator(img): i = node_helpers.pillow(ImageOps.exif_transpose, i) if i.mode == 'I': i = i.point(lambda i: i * (1 / 255)) image = i.convert("RGB") + + if len(output_images) == 0: + w = image.size[0] + h = image.size[1] + + if image.size[0] != w or image.size[1] != h: + continue + image = np.array(image).astype(np.float32) / 255.0 image = torch.from_numpy(image)[None,] if 'A' in i.getbands():