From 2c9447bd7794dca877f7bb4d4ec1cd8586fa23ee Mon Sep 17 00:00:00 2001 From: romeobuilderotti Date: Wed, 15 Nov 2023 18:28:25 +0300 Subject: [PATCH] Support string metadata type for PNG --- nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 2bbfd8fe..01371ff2 100644 --- a/nodes.py +++ b/nodes.py @@ -389,7 +389,7 @@ class SaveLatent: metadata = {"prompt": prompt_info} if extra_pnginfo is not None: for x in extra_pnginfo: - metadata[x] = json.dumps(extra_pnginfo[x]) + metadata[x] = extra_pnginfo[x] if isinstance(extra_pnginfo[x], str) else json.dumps(extra_pnginfo[x]) file = f"{filename}_{counter:05}_.latent" @@ -1305,7 +1305,7 @@ class SaveImage: metadata.add_text("prompt", json.dumps(prompt)) if extra_pnginfo is not None: for x in extra_pnginfo: - metadata.add_text(x, json.dumps(extra_pnginfo[x])) + metadata.add_text(x, extra_pnginfo[x] if isinstance(extra_pnginfo[x], str) else json.dumps(extra_pnginfo[x])) file = f"{filename}_{counter:05}_.png" img.save(os.path.join(full_output_folder, file), pnginfo=metadata, compress_level=4)