From 6acac645a8a2cf5e79c541aac364a702ad6df93e Mon Sep 17 00:00:00 2001 From: Thomas Ward Date: Sun, 12 May 2024 17:15:09 -0400 Subject: [PATCH] Bypass Workflow from extra pnginfo if include_prompt_in_metadata is false --- image.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/image.py b/image.py index 0f17c1d..8fea445 100644 --- a/image.py +++ b/image.py @@ -143,7 +143,7 @@ class HelperNodes_SaveImage(BaseNode): @staticmethod def save_images(images, output_path, filename_prefix, comment, extension, quality_jpeg_or_webp, lossless_webp, - prompt=None, extra_pnginfo=None, include_metadata=True, include_prompt_in_metadata=False, + prompt=None, extra_pnginfo=None, include_metadata=True, include_prompt_in_metadata=True, include_extra_pnginfo=False) -> list[str]: img_count = 1 paths = [] @@ -163,6 +163,8 @@ class HelperNodes_SaveImage(BaseNode): metadata.add_text("prompt", json.dumps(prompt)) if extra_pnginfo is not None and include_extra_pnginfo: for x in extra_pnginfo: + if x == "Workflow" and not include_prompt_in_metadata: + continue # Skip storing the workflow. metadata.add_text(x, json.dumps(extra_pnginfo[x])) filename = f"{filename_prefix}.png"