From a139424b91330401794ca102d830228149bc49a4 Mon Sep 17 00:00:00 2001 From: bennykok Date: Thu, 10 Oct 2024 11:20:12 -0700 Subject: [PATCH] fix: output node status --- custom_routes.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/custom_routes.py b/custom_routes.py index f342e1a..b01760b 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -1009,6 +1009,12 @@ async def send_json_override(self, event, data, sid=None): asyncio.create_task(self.send_json_original(event, data, sid)) ]) + if prompt_id in comfy_message_queues: + comfy_message_queues[prompt_id].put_nowait({ + "event": event, + "data": data + }) + asyncio.create_task(update_run_ws_event(prompt_id, event, data)) if event == 'execution_start': @@ -1083,17 +1089,17 @@ async def send_json_override(self, event, data, sid=None): } if class_type == "PreviewImage": logger.info("Skipping preview image") - return - await update_run_with_output(prompt_id, data.get('output'), node_id=data.get('node'), node_meta=node_meta) + else: + 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 + }) logger.info(f"Executed {class_type} {data}") else: logger.info(f"Executed {data}") - if prompt_id in comfy_message_queues: - comfy_message_queues[prompt_id].put_nowait({ - "event": event, - "data": data - }) # Global variable to keep track of the last read line number last_read_line_number = 0