Browse Source

Feature: Disable Metadata Toggle

pull/2782/head
John Richard Chipps-Harding 9 months ago
parent
commit
f206945c63
  1. 7
      nodes.py

7
nodes.py

@ -1419,7 +1419,8 @@ class SaveImage:
def INPUT_TYPES(s):
return {"required":
{"images": ("IMAGE", ),
"filename_prefix": ("STRING", {"default": "ComfyUI"})},
"filename_prefix": ("STRING", {"default": "ComfyUI"}),
"disable_metadata": ("BOOLEAN", {"default": False})},
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
}
@ -1430,7 +1431,7 @@ class SaveImage:
CATEGORY = "image"
def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
def save_images(self, images, filename_prefix="ComfyUI", disable_metadata=False, prompt=None, extra_pnginfo=None):
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()
@ -1438,7 +1439,7 @@ class SaveImage:
i = 255. * image.cpu().numpy()
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
metadata = None
if not args.disable_metadata:
if not args.disable_metadata and not disable_metadata:
metadata = PngInfo()
if prompt is not None:
metadata.add_text("prompt", json.dumps(prompt))

Loading…
Cancel
Save