From 09dccdd42fa728e06929c4f3f3733094cb302528 Mon Sep 17 00:00:00 2001 From: Skyzi000 <38061609+Skyzi000@users.noreply.github.com> Date: Sun, 12 Apr 2026 05:55:04 +0900 Subject: [PATCH] fix: use unique client_id per ComfyUI WebSocket connection (#23592) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using user.id as client_id causes WebSocket deadlocks when the same user generates images concurrently (e.g., multi-model chat). ComfyUI routes messages by clientId, so shared IDs mean only one connection receives the completion — others hang forever. Generate a unique UUID per request, matching ComfyUI's own examples. --- backend/open_webui/routers/images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/images.py b/backend/open_webui/routers/images.py index dca9a58a7a..0e56da560b 100644 --- a/backend/open_webui/routers/images.py +++ b/backend/open_webui/routers/images.py @@ -681,7 +681,7 @@ async def image_generations( res = await comfyui_create_image( model, form_data, - user.id, + str(uuid.uuid4()), request.app.state.config.COMFYUI_BASE_URL, request.app.state.config.COMFYUI_API_KEY, ) @@ -1011,7 +1011,7 @@ async def image_edits( res = await comfyui_edit_image( model, form_data, - user.id, + str(uuid.uuid4()), request.app.state.config.IMAGES_EDIT_COMFYUI_BASE_URL, request.app.state.config.IMAGES_EDIT_COMFYUI_API_KEY, )