Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
catboxanon committed Oct 16, 2024
1 parent a3cbbc4 commit 58c031e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions stealth.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ def save_images(self, images, filename_prefix="ComfyUI-Stealth", prompt=None, ex
stealth_metadata = {}
metadata = PngInfo()
if prompt is not None:
prompt_json_string = json.dumps(prompt)
if not only_stealth:
metadata.add_text("prompt", json.dumps(prompt))
stealth_metadata["prompt"] = json.dumps(prompt)
metadata.add_text("prompt", prompt_json_string)
stealth_metadata["prompt"] = prompt_json_string
if extra_pnginfo is not None:
for x in extra_pnginfo:
extra_pnginfo_x_json_string = json.dumps(extra_pnginfo[x])
if not only_stealth:
metadata.add_text(x, json.dumps(extra_pnginfo[x]))
stealth_metadata[x] = json.dumps(extra_pnginfo[x])
metadata.add_text(x, extra_pnginfo_x_json_string)
stealth_metadata[x] = extra_pnginfo_x_json_string
if mode == "alpha":
img.putalpha(Image.new("L", img.size, 255))
img = stealth_write(img, json.dumps(stealth_metadata), mode, compressed)
Expand Down

0 comments on commit 58c031e

Please sign in to comment.