Skip to content

Commit

Permalink
Fix SaveAnimatedWEBP not working when metadata is disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Nov 23, 2023
1 parent 4d2437e commit 022033a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions comfy_extras/nodes_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def INPUT_TYPES(s):
CATEGORY = "_for_testing"

def save_images(self, images, fps, filename_prefix, lossless, quality, method, num_frames=0, prompt=None, extra_pnginfo=None):
method = self.methods.get(method, "aoeu")
method = self.methods.get(method)
filename_prefix += self.prefix_append
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])
results = list()
Expand All @@ -85,9 +85,8 @@ def save_images(self, images, fps, filename_prefix, lossless, quality, method, n
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
pil_images.append(img)

metadata = None
metadata = pil_images[0].getexif()
if not args.disable_metadata:
metadata = pil_images[0].getexif()
if prompt is not None:
metadata[0x0110] = "prompt:{}".format(json.dumps(prompt))
if extra_pnginfo is not None:
Expand Down

0 comments on commit 022033a

Please sign in to comment.