From 79836ecfa95982a941367112bf86fd040b7c4b4f Mon Sep 17 00:00:00 2001 From: FeepingCreature Date: Fri, 6 Sep 2024 22:10:39 +0200 Subject: [PATCH] When clearing queued jobs from ComfyUI, only clear the ones we queued in the first place. --- ai_diffusion/comfy_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ai_diffusion/comfy_client.py b/ai_diffusion/comfy_client.py index f18b6a9137..ad8d0a87cb 100644 --- a/ai_diffusion/comfy_client.py +++ b/ai_diffusion/comfy_client.py @@ -342,7 +342,9 @@ async def clear_queue(self): except asyncio.QueueEmpty: break - await self._post("queue", {"clear": True}) + remote_ids = [await job.get_remote_id() for job in self._jobs] + await self._post("api/queue", {"delete": remote_ids}) + self._jobs.clear() async def update_server_queue(self):