[GH-ISSUE #8010] ComfyUI configuration or generation request results in HTTP400 error {"detail":"[ERROR: '<int>']"} #118272

Closed
opened 2026-05-20 19:40:30 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @jtslear on GitHub (Dec 23, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8010

Bug Report

Installation Method

Docker

Environment

  • Open WebUI Version: main or v0.4.8

  • Ollama (if applicable): n/a

  • ComfyUI: I'm keeping up with the default branch, at the time of this writing 601ff9e3

  • Operating System: Bazzite

  • Browser (if applicable): n/a

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama and ComfyUI.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

An error description that provides me information as to what has gone wrong.

Actual Behavior:

INFO: 192.168.50.182:57660 - "GET /images/api/v1/models HTTP/1.1" 400 Bad Request

In the browser the response:

{"detail":"[ERROR: '12']"}

Description

Bug Summary:
I'm receiving a non-useful error when attempting to either save the ComfyUI configuration, or if I somehow get beyond this, and then attempt to generate an image, I get a similar HTTP400 with a differing integer result.

Reproduction Details

Steps to Reproduce:
When attempting to configure the ComfyUI Image integration I'm running into an issue when attempting to apply the settings. I suspect the integers in the error field represent the id's in the node mappings. So in the case when attempting to save settings, node 12.

image

Note I'm using the provided ComfyUI example for using Flux as the model of choice. That documentation

So with the suspicion that node 12 is incorrectly defined, let's remove it. I'm not yet sure what value is set here, perhaps it's empty at this point? Which we know is going to be invalid.

image

BUT, I'm able to successfully save. I'm receiving an HTTP200 with a response:

[{"id":"flux1-dev.safetensors","name":"flux1-dev.safetensors"}]

So I'm thinking everything is fine so let's go generate an image. So I proceed to do so, but then the POST request fails with again, an HTTP400, but a differing error!

{"detail":"[ERROR: '6']"}

I suspect in either case, I'm reaching this bit of code: https://github.com/open-webui/open-webui/blob/main/backend/open_webui/apps/images/main.py#L609 But I have no idea what could be wrong. The same workflow works in ComfyUI and appropriately generates images. Even with debug logging enabled, I don't see anything other than HTTP requests that fail. The one thing I do find interesting is that the attempt to save the config is failing on the endpoint /images/api/v1/models. This suggests something is wrong with a model configuration, but I've followed the docs for Flux, confirmed all is well within ComfyUI. Note that I do see calls to ComfyUI, via packet capture, but I've not been successful at determining what is going wrong. With ComfyUI logging set the debug, nothing is output at all, so I'm not even sure what ComfyUI is doing with these requests. That said, I am getting a valid JSON object back from ComfyUI.

response.json

Note that when attempting to generate an image, no traffic is sent to ComfyUI. I've confirmed this via a packet capture between the two services.

Logs and Screenshots

Browser Console Logs:

Click to open lots of text
index.ts:170 
        
        
       GET http://skardesk:8080/images/api/v1/models 400 (Bad Request)
window.fetch @ fetcher.js:76
p @ index.ts:170
E @ Images.svelte:101
w @ Images.svelte:119
await in w
y @ Images.svelte:262
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
n.$$.update @ Switch.svelte:8
dt @ scheduler.js:115
_t @ scheduler.js:79
Promise.then
ut @ scheduler.js:20
ht @ Component.js:81
(anonymous) @ Component.js:139
T @ Images.svelte:239
Ce @ Images.svelte:282
(anonymous) @ Component.js:138
l @ Switch.svelte:12
i @ switch-thumb.svelte:12
(anonymous) @ Component.js:138
onCheckedChange @ switch.svelte:29
(anonymous) @ overridable.js:9
f @ index.js:69
r @ overridable.js:5
r @ create.js:21
(anonymous) @ create.js:38
(anonymous) @ event.js:23
(anonymous) @ event.js:51
index.ts:183 {detail: "[ERROR: '12']"}
Chat.svelte:132 9b1b9035-d858-4939-a0ac-9a3c1d8d6572
Chat.svelte:337 mounted
Chat.svelte:595 {id: '', title: '🌃 Cyberpunk City Gazer at Night', models: Array(1), params: {…}, history: {…}, …}
Chat.svelte:155 saveSessionSelectedModels ['mistral:latest'] ["mistral:latest"]
Chat.svelte:155 saveSessionSelectedModels ['mistral:latest'] ["mistral:latest"]
Chat.svelte:155 saveSessionSelectedModels ['mistral:latest'] ["mistral:latest"]
RichTextInput.svelte:129 
ChatControls.svelte:208 size 0 31
RichTextInput.svelte:160 [tiptap warn]: Duplicate extension names found: ['codeBlock']. This can lead to issues.
resolve @ index.js:1158
un @ index.js:1144
createExtensionManager @ index.js:4470
_g @ index.js:4302
(anonymous) @ RichTextInput.svelte:160
await in (anonymous)
J @ utils.js:41
(anonymous) @ Component.js:47
_t @ scheduler.js:99
Promise.then
ut @ scheduler.js:20
ht @ Component.js:81
(anonymous) @ Component.js:139
(anonymous) @ Chat.svelte:134
await in (anonymous)
Lp.n.$$.update @ Chat.svelte:141
jt @ Component.js:144
a2 @ Chat.svelte:159
H @ 14.BepEgqDX.js:1
jt @ Component.js:148
v @ +page.svelte:9
se @ dom.js:1228
ot @ root.svelte:57
p @ root.svelte:51
Nt @ utils.js:203
p @ +layout.svelte:241
p @ +layout.svelte:238
dt @ scheduler.js:119
_t @ scheduler.js:79
Promise.then
ut @ scheduler.js:20
ht @ Component.js:81
(anonymous) @ Component.js:139
s.$$set @ root.svelte:69
$set @ Component.js:507
W @ client.js:1422
await in W
(anonymous) @ client.js:2166
index.ts:202 
        
        
       POST http://skardesk:8080/images/api/v1/generations 400 (Bad Request)
window.fetch @ fetcher.js:76
u @ index.ts:202
Qe @ ResponseMessage.svelte:321
Fr @ ResponseMessage.svelte:879
index.ts:218 {detail: "[ERROR: '6']"}

Docker Container Logs:

Notice in the logs the first attempt to save fails, I then remove the node config as noted in the above text and save successfully, only to later fail when asking for the generation API:

Click to open lots of text
INFO:     192.168.50.182:58831 - "GET /api/config HTTP/1.1" 200 OK
INFO  [open_webui.env] Saving 'ENABLE_IMAGE_GENERATION' to the database
INFO:     192.168.50.182:58831 - "GET /images/api/v1/models HTTP/1.1" 400 Bad Request
INFO  [open_webui.env] Saving 'IMAGE_GENERATION_ENGINE' to the database
INFO  [open_webui.env] Saving 'ENABLE_IMAGE_GENERATION' to the database
INFO  [open_webui.env] Saving 'IMAGES_OPENAI_API_BASE_URL' to the database
INFO  [open_webui.env] Saving 'IMAGES_OPENAI_API_KEY' to the database
INFO  [open_webui.env] Saving 'AUTOMATIC1111_BASE_URL' to the database
INFO  [open_webui.env] Saving 'AUTOMATIC1111_API_AUTH' to the database
INFO  [open_webui.env] Saving 'AUTOMATIC1111_CFG_SCALE' to the database
INFO  [open_webui.env] Saving 'AUTOMATIC1111_SAMPLER' to the database
INFO  [open_webui.env] Saving 'AUTOMATIC1111_SCHEDULER' to the database
INFO  [open_webui.env] Saving 'COMFYUI_BASE_URL' to the database
INFO  [open_webui.env] Saving 'COMFYUI_WORKFLOW' to the database
INFO  [open_webui.env] Saving 'COMFYUI_WORKFLOW' to the database
INFO:     192.168.50.182:58934 - "POST /images/api/v1/config/update HTTP/1.1" 200 OK
INFO  [open_webui.apps.images.main] Setting image model to flux1-dev.safetensors
INFO  [open_webui.env] Saving 'IMAGE_GENERATION_MODEL' to the database
INFO  [open_webui.env] Saving 'IMAGE_SIZE' to the database
INFO  [open_webui.env] Saving 'IMAGE_STEPS' to the database
INFO:     192.168.50.182:58934 - "POST /images/api/v1/image/config/update HTTP/1.1" 200 OK
INFO:     192.168.50.182:58934 - "GET /images/api/v1/models HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /api/v1/chats/3fa29bd1-6062-48bd-883b-c2cb367a9a6c HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /api/v1/chats/9bccca5a-cc4f-4bd4-b859-79015f119a14 HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /api/v1/chats/9b1b9035-d858-4939-a0ac-9a3c1d8d6572 HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /api/v1/chats/9b1b9035-d858-4939-a0ac-9a3c1d8d6572 HTTP/1.1" 200 OK
INFO:     192.168.50.182:58992 - "GET /static/favicon.png HTTP/1.1" 304 Not Modified
INFO:     192.168.50.182:58990 - "GET /api/v1/chats/9b1b9035-d858-4939-a0ac-9a3c1d8d6572/tags HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /api/v1/users/user/settings HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /ollama/api/version HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /api/v1/chats/16f6a0dd-978a-4bdf-9d73-3d1f25c608c7 HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "GET /api/v1/chats/f0f8c590-c3c6-4485-98a0-6826c53b0ecb HTTP/1.1" 200 OK
INFO:     192.168.50.182:58990 - "POST /images/api/v1/generations HTTP/1.1" 400 Bad Request

Additional Information

Since we aren't using Open WebUI to initiate a call to any model, as this is ComfyUI's purview, what is the admin setting "Set Default Model" for? If I remove any text here, javascript yells at me. And it doesn't matter if I set it to a model that Open WebUI knows about or not, I'm stuck with the same bad request. I ponder if there's some root causing from this config item.

I know that Open WebUI is successfully able to talk to ComfyUI as the server validation is working. Confirmed via a packet capture as well.

Originally created by @jtslear on GitHub (Dec 23, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8010 # Bug Report ## Installation Method Docker ## Environment - **Open WebUI Version:** `main` or `v0.4.8` - **Ollama (if applicable):** n/a - **ComfyUI:** I'm keeping up with the default branch, at the time of this writing [`601ff9e3`](https://github.com/comfyanonymous/ComfyUI/commit/601ff9e3dbe16b385f20345e329c0c996ab9781f) - **Operating System:** Bazzite - **Browser (if applicable):** n/a **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama and ComfyUI. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: An error description that provides me information as to what has gone wrong. ## Actual Behavior: > `INFO: 192.168.50.182:57660 - "GET /images/api/v1/models HTTP/1.1" 400 Bad Request` In the browser the response: > `{"detail":"[ERROR: '12']"}` ## Description **Bug Summary:** I'm receiving a non-useful error when attempting to either save the ComfyUI configuration, or if I somehow get beyond this, and then attempt to generate an image, I get a similar HTTP400 with a differing integer result. ## Reproduction Details **Steps to Reproduce:** When attempting to configure the ComfyUI Image integration I'm running into an issue when attempting to apply the settings. I suspect the integers in the error field represent the id's in the node mappings. So in the case when attempting to save settings, node 12. ![image](https://github.com/user-attachments/assets/bdf052e7-8a5a-4cfb-bea9-f32a0e83ab9d) Note I'm using the provided ComfyUI example for using Flux as the model of choice. [That documentation](https://comfyui-wiki.com/en/tutorial/advanced/flux1-comfyui-guide-workflow-and-examples) So with the suspicion that node 12 is incorrectly defined, let's remove it. I'm not yet sure what value is set here, perhaps it's empty at this point? Which we know is going to be invalid. ![image](https://github.com/user-attachments/assets/82ebe0b8-c3a3-45a0-bb8c-10649daee7f5) BUT, I'm able to successfully save. I'm receiving an HTTP200 with a response: > `[{"id":"flux1-dev.safetensors","name":"flux1-dev.safetensors"}]` So I'm thinking everything is fine so let's go generate an image. So I proceed to do so, but then the POST request fails with again, an HTTP400, but a differing error! > `{"detail":"[ERROR: '6']"}` I suspect in either case, I'm reaching this bit of code: https://github.com/open-webui/open-webui/blob/main/backend/open_webui/apps/images/main.py#L609 But I have no idea what could be wrong. The same workflow works in ComfyUI and appropriately generates images. Even with debug logging enabled, I don't see anything other than HTTP requests that fail. The one thing I do find interesting is that the attempt to save the config is failing on the endpoint `/images/api/v1/models`. This suggests something is wrong with a model configuration, but I've followed the docs for Flux, confirmed all is well within ComfyUI. Note that I do see calls to ComfyUI, via packet capture, but I've not been successful at determining what is going wrong. With ComfyUI logging set the debug, nothing is output at all, so I'm not even sure what ComfyUI is doing with these requests. That said, I am getting a valid JSON object back from ComfyUI. [response.json](https://github.com/user-attachments/files/18224685/response.json) Note that when attempting to generate an image, no traffic is sent to ComfyUI. I've confirmed this via a packet capture between the two services. ## Logs and Screenshots **Browser Console Logs:** <details><summary>Click to open lots of text</summary> ``` index.ts:170 GET http://skardesk:8080/images/api/v1/models 400 (Bad Request) window.fetch @ fetcher.js:76 p @ index.ts:170 E @ Images.svelte:101 w @ Images.svelte:119 await in w y @ Images.svelte:262 (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 n.$$.update @ Switch.svelte:8 dt @ scheduler.js:115 _t @ scheduler.js:79 Promise.then ut @ scheduler.js:20 ht @ Component.js:81 (anonymous) @ Component.js:139 T @ Images.svelte:239 Ce @ Images.svelte:282 (anonymous) @ Component.js:138 l @ Switch.svelte:12 i @ switch-thumb.svelte:12 (anonymous) @ Component.js:138 onCheckedChange @ switch.svelte:29 (anonymous) @ overridable.js:9 f @ index.js:69 r @ overridable.js:5 r @ create.js:21 (anonymous) @ create.js:38 (anonymous) @ event.js:23 (anonymous) @ event.js:51 index.ts:183 {detail: "[ERROR: '12']"} Chat.svelte:132 9b1b9035-d858-4939-a0ac-9a3c1d8d6572 Chat.svelte:337 mounted Chat.svelte:595 {id: '', title: '🌃 Cyberpunk City Gazer at Night', models: Array(1), params: {…}, history: {…}, …} Chat.svelte:155 saveSessionSelectedModels ['mistral:latest'] ["mistral:latest"] Chat.svelte:155 saveSessionSelectedModels ['mistral:latest'] ["mistral:latest"] Chat.svelte:155 saveSessionSelectedModels ['mistral:latest'] ["mistral:latest"] RichTextInput.svelte:129 ChatControls.svelte:208 size 0 31 RichTextInput.svelte:160 [tiptap warn]: Duplicate extension names found: ['codeBlock']. This can lead to issues. resolve @ index.js:1158 un @ index.js:1144 createExtensionManager @ index.js:4470 _g @ index.js:4302 (anonymous) @ RichTextInput.svelte:160 await in (anonymous) J @ utils.js:41 (anonymous) @ Component.js:47 _t @ scheduler.js:99 Promise.then ut @ scheduler.js:20 ht @ Component.js:81 (anonymous) @ Component.js:139 (anonymous) @ Chat.svelte:134 await in (anonymous) Lp.n.$$.update @ Chat.svelte:141 jt @ Component.js:144 a2 @ Chat.svelte:159 H @ 14.BepEgqDX.js:1 jt @ Component.js:148 v @ +page.svelte:9 se @ dom.js:1228 ot @ root.svelte:57 p @ root.svelte:51 Nt @ utils.js:203 p @ +layout.svelte:241 p @ +layout.svelte:238 dt @ scheduler.js:119 _t @ scheduler.js:79 Promise.then ut @ scheduler.js:20 ht @ Component.js:81 (anonymous) @ Component.js:139 s.$$set @ root.svelte:69 $set @ Component.js:507 W @ client.js:1422 await in W (anonymous) @ client.js:2166 index.ts:202 POST http://skardesk:8080/images/api/v1/generations 400 (Bad Request) window.fetch @ fetcher.js:76 u @ index.ts:202 Qe @ ResponseMessage.svelte:321 Fr @ ResponseMessage.svelte:879 index.ts:218 {detail: "[ERROR: '6']"} ``` </details> **Docker Container Logs:** Notice in the logs the first attempt to save fails, I then remove the node config as noted in the above text and save successfully, only to later fail when asking for the generation API: <details><summary>Click to open lots of text</summary> ``` INFO: 192.168.50.182:58831 - "GET /api/config HTTP/1.1" 200 OK INFO [open_webui.env] Saving 'ENABLE_IMAGE_GENERATION' to the database INFO: 192.168.50.182:58831 - "GET /images/api/v1/models HTTP/1.1" 400 Bad Request INFO [open_webui.env] Saving 'IMAGE_GENERATION_ENGINE' to the database INFO [open_webui.env] Saving 'ENABLE_IMAGE_GENERATION' to the database INFO [open_webui.env] Saving 'IMAGES_OPENAI_API_BASE_URL' to the database INFO [open_webui.env] Saving 'IMAGES_OPENAI_API_KEY' to the database INFO [open_webui.env] Saving 'AUTOMATIC1111_BASE_URL' to the database INFO [open_webui.env] Saving 'AUTOMATIC1111_API_AUTH' to the database INFO [open_webui.env] Saving 'AUTOMATIC1111_CFG_SCALE' to the database INFO [open_webui.env] Saving 'AUTOMATIC1111_SAMPLER' to the database INFO [open_webui.env] Saving 'AUTOMATIC1111_SCHEDULER' to the database INFO [open_webui.env] Saving 'COMFYUI_BASE_URL' to the database INFO [open_webui.env] Saving 'COMFYUI_WORKFLOW' to the database INFO [open_webui.env] Saving 'COMFYUI_WORKFLOW' to the database INFO: 192.168.50.182:58934 - "POST /images/api/v1/config/update HTTP/1.1" 200 OK INFO [open_webui.apps.images.main] Setting image model to flux1-dev.safetensors INFO [open_webui.env] Saving 'IMAGE_GENERATION_MODEL' to the database INFO [open_webui.env] Saving 'IMAGE_SIZE' to the database INFO [open_webui.env] Saving 'IMAGE_STEPS' to the database INFO: 192.168.50.182:58934 - "POST /images/api/v1/image/config/update HTTP/1.1" 200 OK INFO: 192.168.50.182:58934 - "GET /images/api/v1/models HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /api/v1/chats/3fa29bd1-6062-48bd-883b-c2cb367a9a6c HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /api/v1/chats/9bccca5a-cc4f-4bd4-b859-79015f119a14 HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /api/v1/chats/9b1b9035-d858-4939-a0ac-9a3c1d8d6572 HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /api/v1/chats/9b1b9035-d858-4939-a0ac-9a3c1d8d6572 HTTP/1.1" 200 OK INFO: 192.168.50.182:58992 - "GET /static/favicon.png HTTP/1.1" 304 Not Modified INFO: 192.168.50.182:58990 - "GET /api/v1/chats/9b1b9035-d858-4939-a0ac-9a3c1d8d6572/tags HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /api/v1/users/user/settings HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /ollama/api/version HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /api/v1/chats/16f6a0dd-978a-4bdf-9d73-3d1f25c608c7 HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "GET /api/v1/chats/f0f8c590-c3c6-4485-98a0-6826c53b0ecb HTTP/1.1" 200 OK INFO: 192.168.50.182:58990 - "POST /images/api/v1/generations HTTP/1.1" 400 Bad Request ``` </details> ## Additional Information Since we aren't using Open WebUI to initiate a call to any model, as this is ComfyUI's purview, what is the admin setting "Set Default Model" for? If I remove any text here, javascript yells at me. And it doesn't matter if I set it to a model that Open WebUI knows about or not, I'm stuck with the same bad request. I ponder if there's some root causing from this config item. I know that Open WebUI is successfully able to talk to ComfyUI as the server validation is working. Confirmed via a packet capture as well.
Author
Owner

@jtslear commented on GitHub (Dec 23, 2024):

Regarding my additional information portion, the configuration item Set Default Model is not mentioned in the documentation. 15df6c51c1/docs/tutorials/integrations/images.md (L110)

<!-- gh-comment-id:2558830468 --> @jtslear commented on GitHub (Dec 23, 2024): Regarding my additional information portion, the configuration item Set Default Model is not mentioned in the documentation. https://github.com/open-webui/docs/blob/15df6c51c1ebb58ee350fe5258c3fb6143b23c65/docs/tutorials/integrations/images.md?plain=1#L110
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#118272