mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 09:51:35 +00:00
fix: a failed ComfyUI run is reported as a successful image generation with no images (#33237)
This commit is contained in:
parent
1ae310b622
commit
d1ae9e75e0
1 changed files with 7 additions and 0 deletions
|
|
@ -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 [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue