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

Loading…
Cancel
Save