From 88185aeb81afe9fb7386b8010cd9800c0cd8f986 Mon Sep 17 00:00:00 2001 From: josephrocca <1167575+josephrocca@users.noreply.github.com> Date: Wed, 28 May 2025 02:39:48 +0800 Subject: [PATCH] Optionally specify a `prompt_id` in `/interrupt` endpoint --- server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 1b0a73601..3ee7bad41 100644 --- a/server.py +++ b/server.py @@ -685,7 +685,14 @@ class PromptServer(): @routes.post("/interrupt") async def post_interrupt(request): - nodes.interrupt_processing() + json_data = await request.json() + if "id" in json_data: + current_queue = self.prompt_queue.get_current_queue_volatile() + queue_running = current_queue[0] + if len(queue_running) > 0 and queue_running[0][1] == json_data["id"]: + nodes.interrupt_processing() + else: + nodes.interrupt_processing() return web.Response(status=200) @routes.post("/free")