Skip to content

Commit 09dccdd

Browse files
authored
fix: use unique client_id per ComfyUI WebSocket connection (open-webui#23592)
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.
1 parent be38ca8 commit 09dccdd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/open_webui/routers/images.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ async def image_generations(
681681
res = await comfyui_create_image(
682682
model,
683683
form_data,
684-
user.id,
684+
str(uuid.uuid4()),
685685
request.app.state.config.COMFYUI_BASE_URL,
686686
request.app.state.config.COMFYUI_API_KEY,
687687
)
@@ -1011,7 +1011,7 @@ def get_image_file_item(base64_string, param_name='image'):
10111011
res = await comfyui_edit_image(
10121012
model,
10131013
form_data,
1014-
user.id,
1014+
str(uuid.uuid4()),
10151015
request.app.state.config.IMAGES_EDIT_COMFYUI_BASE_URL,
10161016
request.app.state.config.IMAGES_EDIT_COMFYUI_API_KEY,
10171017
)

0 commit comments

Comments
 (0)