mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #19837] issue: Image creation with Gemini 2.5 Flash Image leads to error "Please use a valid role: user, model" #19013
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 @Philoso-Fish on GitHub (Dec 9, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19837
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.6.41
Ollama Version (if applicable)
No response
Operating System
Windows 11
Browser (if applicable)
Chrome
Confirmation
README.md.Expected Behavior
Given a specific prompt, an image should be created.
Actual Behavior
The language model (in this example GPT4o) gives the following output:
"I'm currently unable to generate images due to an error. The error message is: [ERROR: Please use a valid role: user, model.] However, if you need assistance with something else or further information on dogs, feel free to ask!"
Steps to Reproduce
It is also important to mention that we use a LiteLLM Proxy in the connection settings. All language models (e.g., GPT4o) are provided via LiteLLM. The image model Gemini 2.5 flash image is not provided by LiteLLM.
Logs & Screenshots
The error message is only provided in the answer of the language model and cannot be seen inside the logs of openwebui.
Here are the current settings:
Connections:

Models: (via LiteLLM)

Images:
Additional Information
Base URL and API Key are correct, speaking outside of open webui with the image model works fine.
The issue occurs for all connected models.
@owui-terminator[bot] commented on GitHub (Dec 9, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#17626 issue: "Chunk too big" error when using Google Gemini 2.5 Flash with image input
by BND-1 • Sep 21, 2025 •
bug#19702 issue: Image generation tool causes inconsistency between model response and actual generated image
by manwallet • Dec 03, 2025 •
bug#19532 issue: using the gemini-3-pro-image-preview model via OpenRouter to generate images, multiple identical images are displayed.
by liuuuu-pro • Nov 27, 2025 •
bug#15404 issue: Image Generation Fails to Work
by lie5860 • Jun 30, 2025 •
bug#19425 issue: Can't connect to Gemini in v0.6.38
by davidpede • Nov 24, 2025 •
bugShow 5 more related issues
#12951 issue: Chunk to big error occurs when using Gemini inline image generation
by ddddavid-he • Apr 17, 2025 •
bug#14419 issue: Image creation fails in 0.6.11
by dyioulos • May 27, 2025 •
bug#17466 issue: LLMs such as Gemma3 unable to interpret images
by batcheej • Sep 15, 2025 •
bug#19518 issue: Duplicate images displayed in gemini-3-pro-image-preview chats
by davidpede • Nov 26, 2025 •
bug#19451 issue: Images with gpt-image-1 ERROR: No connection adapters were found
by 3keyallen3 • Nov 25, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@Classic298 commented on GitHub (Dec 9, 2025):
I still have the same issue. I am not sure where the issue actually comes from, if it is improper handling by Open WebUI or a LiteLLM endpoint issue
I'll transfer this to discussions for now because this is a duplicate issue, but yes this needs some investigation where the issue actually comes from. Either the images.py backend or some api endpoint conflict.