生成的图片元信息不要包含输入的base64图

This commit is contained in:
刘雪峰
2024-01-11 19:31:33 +08:00
parent 90df5146a8
commit 1a8c571646
2 changed files with 19 additions and 0 deletions
+4
View File
@@ -94,6 +94,10 @@ class ImageToBase64Advanced:
if not args.disable_metadata:
metadata = PngInfo()
if prompt is not None:
for idx in prompt:
node = prompt[idx]
if node['class_type'] == 'Base64ToImage' or node['class_type'] == 'Base64ToMask':
node['inputs']['base64Images'] = ""
metadata.add_text("prompt", json.dumps(prompt))
if extra_pnginfo is not None:
for x in extra_pnginfo:
+15
View File
@@ -2,6 +2,8 @@ import sys
from datetime import datetime as dt
from server import PromptServer
old_stdout = sys.stdout
old_stderr = sys.stderr
@@ -38,6 +40,19 @@ class StdTimeFilter:
old_stderr.flush()
def socket_wrap(func):
def wrap_func(event, data, sid=None):
if event == "executed" or event == "executing":
print("send message begin, type={}, node={}".format(event, data['node']))
else:
print("send message begin, {}".format(event))
func(event, data, sid)
print("send message end, {}".format(event))
return wrap_func
def log_wrap():
sys.stdout = StdTimeFilter(True)
sys.stderr = StdTimeFilter(False)
# old_send_sync = PromptServer.instance.send_sync
# PromptServer.instance.send_sync = socket_wrap(old_send_sync)