mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #22309] issue: Image generation fails in temporary chat mode #35222
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wsomm on GitHub (Mar 6, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22309
Check Existing Issues
Installation Method
Pip Install
Open WebUI Version
0.8.8
Ollama Version (if applicable)
No response
Operating System
Mac os Tahoe
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Generate me a picture of a sunset.
Expected: the generated picture.
Actual Behavior
The picture is generated but not displayed.
Happening with Nanao Banana and tool call with gpt-oss with configured image generation.
Steps to Reproduce
Just call "paint me a picture of a sunset" on a Google Nano Banana model.
Logs & Screenshots
No log entries found.
Additional Information
Note: Sometimes it works. Arbitrarily.
@Classic298 commented on GitHub (Mar 6, 2026):
just tested, works. cannot reproduce.
Gemini 3 Pro Image Preview was used, native tool calling.
@wsomm commented on GitHub (Mar 6, 2026):
Ok. But doesn't work here! Additional information I found:
when it works the log contains:
When it fails in temporary chat the log is
I am willing to do anything to solve this, at the moment it looks like a failure in OWUI 0.8.8
And as I already wrote: sometimes it works even here.
At the moment I have no idea where to search else.
The pic is generated, but not displayed. And only in temporary chat.
@Classic298 commented on GitHub (Mar 6, 2026):
how did you configure your image generation settings?
what reverse proxy settings?
any console logs or browser logs of the image perhaps getting blocked or failing to load?
@wsomm commented on GitHub (Mar 6, 2026):
This is straight to Google Nano Banana, but through liteLLM Poxy.
Reverse Proxy is via apache2.
One additional thing: In temporary mode no image is stored in the upload folder, in normal mode it is.
But this might be intended behaviour to be private.
I'll check, if I find something on the reverse proxy side, that might be a potential point of failure.
@Classic298 commented on GitHub (Mar 6, 2026):
yes its intended to not be stored in the upload folder
anything in the browser network logs and console logs?
@wsomm commented on GitHub (Mar 6, 2026):
I have 503 errors in the websocket communication, this would explain the behaviour. I'll investigate further. Thank you.
@wsomm commented on GitHub (Mar 6, 2026):
ok. the websocket had nothing to do with the problem.
I had Claude code investigate the problem and it came up with a fix that worked. Here is the summary:
Bug: Images not displayed in Temporary Chat when using builtin
generate_imagetool (native function calling)Description
When using a model configured with builtin tools (native function calling) for image generation, generated images are not displayed in Temporary Chat mode. The image is successfully generated and uploaded to the server, but the frontend never receives the file event, so nothing is shown.
In normal (persistent) chat mode, the same model displays images correctly.
Root Cause
The bug is in 3 locations where
Chats.add_message_files_by_id_and_message_id()is called. This function returnsNonewhen the chat doesn't exist in the database — which is always the case for temporary chats (chat IDs starting withlocal:).Primary location —
open_webui/tools/builtin.py,generate_image()function (~line 249-260):The same pattern exists in:
open_webui/tools/builtin.py,edit_image()function (~line 317-325) — identical bugopen_webui/utils/middleware.py, SSE streaming handler (~line 3770-3784) — emits{"files": null}instead of the image listWhy this bug is hard to reproduce
This bug only affects the builtin tool (native function calling) code path, not the feature-based image generation path. Which path is taken depends on the model configuration:
capabilities.image_generation: true+ no native FCchat_image_generation_handler()in middleware.py (line 1767)builtinTools.image_generation: true(native FC)generate_image()in builtin.py (line 253)Most users and testers likely use models where
image_generationis set as a capability (the older/simpler approach), which useschat_image_generation_handler(). This handler constructs the files event directly from theimage_generations()return value and emits it without going through the DB — so it works fine in temporary chats.The bug only manifests when a model uses the builtin tools approach (native function calling), where
generate_imageinbuiltin.pyis invoked as a tool call by the LLM. This is the newer approach used by models configured withbuiltinTools: { image_generation: true }.Fix
The fix is minimal — don't overwrite
image_fileswhen the DB function returnsNone:builtin.py (
generate_imageandedit_image):middleware.py (SSE streaming handler):
Steps to Reproduce
builtinTools: { image_generation: true }andcapabilities: { image_generation: false }(i.e., image generation via native function calling, not via the feature flag)Environment
WebSocket Evidence
In temporary chat, the socket event shows
files: null:After the fix, it correctly sends the image file list.
@Classic298 commented on GitHub (Mar 6, 2026):
going to investigate
@Classic298 commented on GitHub (Mar 6, 2026):
https://github.com/open-webui/open-webui/pull/22330
@tjbck commented on GitHub (Mar 7, 2026):
Addressed in dev.
@Classic298 commented on GitHub (Mar 7, 2026):
d4faa5a5ea