This commit is contained in:
karrix 2024-10-22 14:56:06 +08:00
parent fdbf24207f
commit c82f0c2bf0
2 changed files with 10 additions and 12 deletions

View File

@ -9,7 +9,7 @@ import folder_paths
class ComfyDeployStdOutputImage: class ComfyDeployStdOutputImage:
def __init__(self): def __init__(self):
self.output_dir = folder_paths.get_output_directory() self.output_dir = folder_paths.get_output_directory()
self.type = "std_output" self.type = "output"
self.prefix_append = "" self.prefix_append = ""
self.compress_level = 4 self.compress_level = 4
@ -36,7 +36,7 @@ class ComfyDeployStdOutputImage:
OUTPUT_NODE = True OUTPUT_NODE = True
CATEGORY = "std_output" CATEGORY = "output"
DESCRIPTION = "Saves the input images to your ComfyUI output directory." DESCRIPTION = "Saves the input images to your ComfyUI output directory."
def run( def run(

View File

@ -1229,12 +1229,13 @@ async def send_json_override(self, event, data, sid=None):
# if class_type == "PreviewImage": # if class_type == "PreviewImage":
# logger.info("Skipping preview image") # logger.info("Skipping preview image")
# else: # else:
await update_run_with_output( if class_type == "ComfyDeployStdOutputImage":
prompt_id, await update_run_with_output(
data.get("output"), prompt_id,
node_id=data.get("node"), data.get("output"),
node_meta=node_meta, node_id=data.get("node"),
) node_meta=node_meta,
)
if prompt_id in comfy_message_queues: if prompt_id in comfy_message_queues:
comfy_message_queues[prompt_id].put_nowait( comfy_message_queues[prompt_id].put_nowait(
{"event": "output_ready", "data": data} {"event": "output_ready", "data": data}
@ -1765,10 +1766,7 @@ async def update_run_with_output(
have_upload_media = False have_upload_media = False
if data is not None: if data is not None:
have_upload_media = ( have_upload_media = (
"images" in data "images" in data or "files" in data or "gifs" in data or "mesh" in data
and isinstance(data.get("images"), list)
and len(data["images"]) > 0
and data["images"][0].get("type") == "std_output"
) )
if bypass_upload and have_upload_media: if bypass_upload and have_upload_media:
print( print(