[GH-ISSUE #23244] issue: Image generation fails (empty response) when using Gemini as chat model, but works with GPT models #74531

Closed
opened 2026-05-13 07:18:08 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Tetsuro-Copa on GitHub (Mar 31, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23244

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v 0.8.12

Ollama Version (if applicable)

No response

Operating System

Windows 11

Browser (if applicable)

Brave (Chromium)

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

Expected Behavior

When requesting image generation (e.g. "Generate an image of a cat dancing on a cake"), the system should:

  • Trigger the image generation tool (generate_image)
  • Return a valid response
  • Populate content, output, and files with the generated image

Actual Behavior

Actual Behavior

When using Gemini as the chat model:

  • Assistant message is saved with:
    • content: ""
    • output: []
    • done: true
  • No error is shown in logs
  • No image is generated or displayed
  • Follow-up suggestions still appear

This is a silent failure.

Steps to Reproduce

Description

Image generation fails silently when using a Gemini model (e.g. gemini-2.5-pro) as the chat model in OpenWebUI.

The same image generation setup works correctly when switching the chat model to a GPT-based model (e.g. gpt-5).

Comparison

Working Configuration

  • Chat Model: gpt-5
  • Image Model: gpt-image-1

Result:

  • Tool call (generate_image) is executed
  • Image is generated and stored in files
  • Response is correctly displayed

Failing Configuration

  • Chat Model: gemini-2.5-pro
  • Image Model: gpt-image-1

Result:

  • No tool execution output is recorded
  • Assistant response is empty
  • files is empty

Additional Observations

  • Basic text chat works correctly with Gemini
  • Failures occur only when:
    • Image generation is requested
    • Web search / tool-based features are used
  • Disabling Tools prevents silent failure in some cases, but image generation still fails

Environment

  • OpenWebUI version: v0.8.12
  • Deployment: Docker (Windows host)
  • Reverse proxy: Caddy (LAN only, HTTPS)
  • Browser: Chrome / Brave (both tested)

Hypothesis

The issue appears to be related to how OpenWebUI handles tool/function calls when using Gemini models.

Possibly:

  • Gemini responses are not parsed correctly into tool calls
  • Or the tool execution output is not properly mapped into content / output

Request

  • Is Gemini officially supported for tool-based image generation workflows?
  • Are there known compatibility issues with Gemini and generate_image?
  • Is there a recommended configuration for combining Gemini (chat) with OpenAI (image)?

Any guidance or confirmation would be appreciated.

Logs & Screenshots

Logs

No errors are reported in logs during failure.

Relevant behavior:

  • /api/chat/completions returns 200
  • /api/chat/completed returns 200
  • Final stored message is empty

Additional Information

No response

Originally created by @Tetsuro-Copa on GitHub (Mar 31, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/23244 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v 0.8.12 ### Ollama Version (if applicable) _No response_ ### Operating System Windows 11 ### Browser (if applicable) Brave (Chromium) ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior ## Expected Behavior When requesting image generation (e.g. "Generate an image of a cat dancing on a cake"), the system should: - Trigger the image generation tool (`generate_image`) - Return a valid response - Populate `content`, `output`, and `files` with the generated image ### Actual Behavior ## Actual Behavior When using Gemini as the chat model: - Assistant message is saved with: - `content: ""` - `output: []` - `done: true` - No error is shown in logs - No image is generated or displayed - Follow-up suggestions still appear This is a silent failure. ### Steps to Reproduce ## Description Image generation fails silently when using a Gemini model (e.g. `gemini-2.5-pro`) as the chat model in OpenWebUI. The same image generation setup works correctly when switching the chat model to a GPT-based model (e.g. `gpt-5`). ## Comparison ### Working Configuration - Chat Model: `gpt-5` - Image Model: `gpt-image-1` Result: - Tool call (`generate_image`) is executed - Image is generated and stored in `files` - Response is correctly displayed ### Failing Configuration - Chat Model: `gemini-2.5-pro` - Image Model: `gpt-image-1` Result: - No tool execution output is recorded - Assistant response is empty - `files` is empty ## Additional Observations - Basic text chat works correctly with Gemini - Failures occur only when: - Image generation is requested - Web search / tool-based features are used - Disabling Tools prevents silent failure in some cases, but image generation still fails ## Environment - OpenWebUI version: v0.8.12 - Deployment: Docker (Windows host) - Reverse proxy: Caddy (LAN only, HTTPS) - Browser: Chrome / Brave (both tested) ## Hypothesis The issue appears to be related to how OpenWebUI handles tool/function calls when using Gemini models. Possibly: - Gemini responses are not parsed correctly into tool calls - Or the tool execution output is not properly mapped into `content` / `output` ## Request - Is Gemini officially supported for tool-based image generation workflows? - Are there known compatibility issues with Gemini and `generate_image`? - Is there a recommended configuration for combining Gemini (chat) with OpenAI (image)? Any guidance or confirmation would be appreciated. ### Logs & Screenshots ## Logs No errors are reported in logs during failure. Relevant behavior: - `/api/chat/completions` returns 200 - `/api/chat/completed` returns 200 - Final stored message is empty ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-13 07:18:08 -05:00
Author
Owner

@tjbck commented on GitHub (Apr 2, 2026):

Does gemini-2.5-pro support full openai compatiblity?

<!-- gh-comment-id:4175171351 --> @tjbck commented on GitHub (Apr 2, 2026): Does `gemini-2.5-pro` support full openai compatiblity?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#74531