Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix APNG not working in ffmpeg.

comfyanonymous8ad5d494d528
diff --git a/comfy_extras/nodes_images.py b/comfy_extras/nodes_images.py
index 4c86b2df6..4b6cd3d1b 100644
--- a/comfy_extras/nodes_images.py
+++ b/comfy_extras/nodes_images.py
@@ -152,10 +152,10 @@ class SaveAnimatedPNG:
if not args.disable_metadata:
metadata = PngInfo()
if prompt is not None:
- metadata.add_text("prompt", json.dumps(prompt))
+ metadata.add(b"tEXt", "prompt".encode("latin-1", "strict") + b"\0" + json.dumps(prompt).encode("latin-1", "strict"), after_idat=True)
if extra_pnginfo is not None:
for x in extra_pnginfo:
- metadata.add_text(x, json.dumps(extra_pnginfo[x]))
+ metadata.add(b"tEXt", x.encode("latin-1", "strict") + b"\0" + json.dumps(extra_pnginfo[x]).encode("latin-1", "strict"), after_idat=True)
file = f"{filename}_{counter:05}_.png"
pil_images[0].save(os.path.join(full_output_folder, file), pnginfo=metadata, compress_level=compress_level, save_all=True, duration=int(1000.0/fps), append_images=pil_images[1:])