From d1ae9e75e00ab4401454a76c8e782dca193ff3e2 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:21:01 -0400 Subject: [PATCH] fix: a failed ComfyUI run is reported as a successful image generation with no images (#33237) --- backend/open_webui/utils/images/comfyui.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/open_webui/utils/images/comfyui.py b/backend/open_webui/utils/images/comfyui.py index 6447a69f88..d8b07926b3 100644 --- a/backend/open_webui/utils/images/comfyui.py +++ b/backend/open_webui/utils/images/comfyui.py @@ -87,6 +87,13 @@ async def _ws_get_images(ws, workflow, client_id, base_url, api_key): # binary messages (previews) are silently skipped history = (await get_history(prompt_id, base_url, api_key))[prompt_id] + status = history.get('status', {}) + if status.get('status_str') == 'error': + error = next((data for kind, data in status.get('messages', []) if kind == 'execution_error'), {}) + raise Exception( + f'ComfyUI {error.get("node_type", "workflow")} failed: {error.get("exception_message", "").strip()}' + ) + for node_id in history['outputs']: node_output = history['outputs'][node_id] if node_id in workflow and workflow[node_id].get('class_type') in [