From 7189f132636566e430ee696151f9deb97536f14c Mon Sep 17 00:00:00 2001 From: bennykok Date: Mon, 18 Mar 2024 14:31:43 -0700 Subject: [PATCH] fix: added queue_prompt from event, now input and image will not trigger queue prompt --- custom_routes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_routes.py b/custom_routes.py index ecf0f3f..6858923 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -480,6 +480,7 @@ async def websocket_handler(request): print("Got input: ", data.get("inputs")) input = data.get('inputs') streaming_prompt_metadata[sid].inputs.update(input) + elif event_type == 'queue_prompt': clear_current_prompt(sid) send_prompt(sid, streaming_prompt_metadata[sid]) else: @@ -519,8 +520,8 @@ async def websocket_handler(request): except Exception as e: print(f"Error closing previous image for input ID {input_id}: {e}") streaming_prompt_metadata[sid].inputs[input_id] = image - clear_current_prompt(sid) - send_prompt(sid, streaming_prompt_metadata[sid]) + # clear_current_prompt(sid) + # send_prompt(sid, streaming_prompt_metadata[sid]) print(f"Received {image_type} image of size {image.size} with input ID {input_id}") if msg.type == aiohttp.WSMsgType.ERROR: