Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebc71a7d72 | ||
|
|
9076b4c0ce | ||
|
|
e34d1651f7 |
@@ -33,6 +33,7 @@ class ComfyDeployOutputImage:
|
|||||||
"STRING",
|
"STRING",
|
||||||
{"multiline": False, "default": "output_images"},
|
{"multiline": False, "default": "output_images"},
|
||||||
),
|
),
|
||||||
|
"remove_metadata": ("BOOLEAN", {"default": True}),
|
||||||
},
|
},
|
||||||
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
|
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
|
||||||
}
|
}
|
||||||
@@ -53,6 +54,7 @@ class ComfyDeployOutputImage:
|
|||||||
output_id="output_images",
|
output_id="output_images",
|
||||||
prompt=None,
|
prompt=None,
|
||||||
extra_pnginfo=None,
|
extra_pnginfo=None,
|
||||||
|
remove_metadata=True,
|
||||||
):
|
):
|
||||||
filename_prefix += self.prefix_append
|
filename_prefix += self.prefix_append
|
||||||
full_output_folder, filename, counter, subfolder, filename_prefix = (
|
full_output_folder, filename, counter, subfolder, filename_prefix = (
|
||||||
@@ -65,11 +67,12 @@ class ComfyDeployOutputImage:
|
|||||||
i = 255.0 * image.cpu().numpy()
|
i = 255.0 * 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 = PngInfo()
|
metadata = PngInfo()
|
||||||
if prompt is not None:
|
if not remove_metadata:
|
||||||
metadata.add_text("prompt", json.dumps(prompt))
|
if prompt is not None:
|
||||||
if extra_pnginfo is not None:
|
metadata.add_text("prompt", json.dumps(prompt))
|
||||||
for x in extra_pnginfo:
|
if extra_pnginfo is not None:
|
||||||
metadata.add_text(x, json.dumps(extra_pnginfo[x]))
|
for x in extra_pnginfo:
|
||||||
|
metadata.add_text(x, json.dumps(extra_pnginfo[x]))
|
||||||
|
|
||||||
filename_with_batch_num = filename.replace("%batch_num%", str(batch_number))
|
filename_with_batch_num = filename.replace("%batch_num%", str(batch_number))
|
||||||
file = f"{filename_with_batch_num}_{counter:05}_.{file_type}"
|
file = f"{filename_with_batch_num}_{counter:05}_.{file_type}"
|
||||||
|
|||||||
Reference in New Issue
Block a user