From c82f0c2bf0d4b4474506792b557ab479c680b8f8 Mon Sep 17 00:00:00 2001 From: karrix Date: Tue, 22 Oct 2024 14:56:06 +0800 Subject: [PATCH] tweak --- comfy-nodes/comfy_std_output_image.py | 4 ++-- custom_routes.py | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/comfy-nodes/comfy_std_output_image.py b/comfy-nodes/comfy_std_output_image.py index aa47c95..a498c15 100644 --- a/comfy-nodes/comfy_std_output_image.py +++ b/comfy-nodes/comfy_std_output_image.py @@ -9,7 +9,7 @@ import folder_paths class ComfyDeployStdOutputImage: def __init__(self): self.output_dir = folder_paths.get_output_directory() - self.type = "std_output" + self.type = "output" self.prefix_append = "" self.compress_level = 4 @@ -36,7 +36,7 @@ class ComfyDeployStdOutputImage: OUTPUT_NODE = True - CATEGORY = "std_output" + CATEGORY = "output" DESCRIPTION = "Saves the input images to your ComfyUI output directory." def run( diff --git a/custom_routes.py b/custom_routes.py index 13e8ed4..10ef50f 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -1229,12 +1229,13 @@ async def send_json_override(self, event, data, sid=None): # if class_type == "PreviewImage": # logger.info("Skipping preview image") # else: - await update_run_with_output( - prompt_id, - data.get("output"), - node_id=data.get("node"), - node_meta=node_meta, - ) + if class_type == "ComfyDeployStdOutputImage": + await update_run_with_output( + prompt_id, + data.get("output"), + node_id=data.get("node"), + node_meta=node_meta, + ) if prompt_id in comfy_message_queues: comfy_message_queues[prompt_id].put_nowait( {"event": "output_ready", "data": data} @@ -1765,10 +1766,7 @@ async def update_run_with_output( have_upload_media = False if data is not None: have_upload_media = ( - "images" in data - and isinstance(data.get("images"), list) - and len(data["images"]) > 0 - and data["images"][0].get("type") == "std_output" + "images" in data or "files" in data or "gifs" in data or "mesh" in data ) if bypass_upload and have_upload_media: print(