From 086359c709282d8f2ecc2d956fa2d4871d0af6ff Mon Sep 17 00:00:00 2001 From: aculeasis <42580940+Aculeasis@users.noreply.github.com> Date: Thu, 22 May 2025 09:05:24 +0300 Subject: [PATCH] fix: Correct workflow metadata saving when save_workflow_image is false PngInfo.add_text(key, val) does not overwrite an existing key, so the workflow could still be extracted from the file. --- py/nodes/node.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py/nodes/node.py b/py/nodes/node.py index ae25116b..bb0a88c6 100644 --- a/py/nodes/node.py +++ b/py/nodes/node.py @@ -110,10 +110,10 @@ def save_images( metadata.add_text("prompt", json.dumps(prompt)) if extra_pnginfo is not None: for x in extra_pnginfo: + if not save_workflow_image and x == "workflow": + continue metadata.add_text(x, json.dumps(extra_pnginfo[x])) - if save_workflow_image == False: - metadata.add_text("workflow", "") - + filename_prefix = self.format_filename(filename_prefix, pnginfo_dict) output_path = os.path.join(self.output_dir, filename_prefix) if not os.path.exists(os.path.dirname(output_path)):