[GH-ISSUE #21955] bug: Duplicate images displayed when model with thinking/reasoning generates an image (e.g., Gemini 3 Pro Image Preview) #58291

Closed
opened 2026-05-05 22:48:04 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @ashm-dev on GitHub (Feb 28, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21955

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

v0.8.5 (also confirmed on latest dev branch — commit f5bf2a2ed)

Ollama Version (if applicable)

N/A

Operating System

Linux (Arch Linux 6.18.9)

Browser (if applicable)

Chromium 133

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

When a model (e.g., google/gemini-3-pro-image-preview via OpenRouter) generates one image in response, one image should be displayed in the chat.

Actual Behavior

The same image is duplicated multiple times in the response. The number of duplicates varies non-deterministically between requests:

  • Observed 2 duplicates, 3 duplicates, and 6 duplicates across different requests with the identical prompt.
  • All duplicates point to the same generated image (verified by comparing base64 data and file URLs in the database).

Querying the chat data via /api/v1/chats/{id} confirms that history.messages[messageId].files contains duplicate entries. Example from one request:

"files": [
  {"type": "image", "url": "/api/v1/files/b7041e54-2262-4813-96d3-8ff44d34e512/content"},
  {"type": "image", "url": "/api/v1/files/b7041e54-2262-4813-96d3-8ff44d34e512/content"}
]

The exact same file URL appears multiple times. The duplicates are persisted in the database — reloading the page still shows the same number of duplicate images.

Steps to Reproduce

  1. Install Open WebUI v0.8.5 (Docker or pip).
  2. Configure an OpenRouter connection with a model that supports both thinking/reasoning and image generation (e.g., google/gemini-3-pro-image-preview).
  3. Start a new chat and select the model.
  4. Send a prompt that triggers image generation, e.g.: A giraffe with a hilariously long neck
  5. Do not interact with the UI — just wait for the response to complete.
  6. Observe that 2 or more identical images are displayed in the response.
  7. Verify via API: GET /api/v1/chats/{chat_id} → check history.messages[assistantMessageId].files — it contains duplicate entries with the same URL.

Logs & Screenshots

Screenshot showing 3 identical images in a single response:

Image

No browser console errors — only a tiptap warning unrelated to this issue:

[tiptap warn]: Duplicate extension names found: [...]

Database evidence (from /api/v1/chats/{id} response):

  • Request 1: message.files contains 3 entries (2 identical + 1 with slightly different encoding)
  • Request 2: message.files contains 2 entries (same file URL twice)
  • Request 3: message.files contains 6 entries (4 of type A + 2 of type B, all visually identical)

Additional Information

  • This issue was previously reported in #19518 (closed 2025-11-26 as COMPLETED) but remains unfixed.
  • The image handling in streaming deltas was introduced in PR #19073 (commit 31dc97b68, 2025-11-19). The latest dev branch (f5bf2a2ed) still contains the same code path without changes to address duplication.
  • The model used for testing: google/gemini-3-pro-image-preview via OpenRouter (called "Nano Banana Pro" locally). The model supports extended thinking (reasoning) and native image generation.
  • The duplication count is non-deterministic and does not correlate with user interaction (e.g., toggling the thinking/reasoning collapsible block does not affect the count).
Originally created by @ashm-dev on GitHub (Feb 28, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/21955 ### 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 v0.8.5 (also confirmed on latest `dev` branch — commit f5bf2a2ed) ### Ollama Version (if applicable) N/A ### Operating System Linux (Arch Linux 6.18.9) ### Browser (if applicable) Chromium 133 ### 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 When a model (e.g., `google/gemini-3-pro-image-preview` via OpenRouter) generates **one** image in response, **one** image should be displayed in the chat. ### Actual Behavior The same image is duplicated multiple times in the response. The number of duplicates varies non-deterministically between requests: - Observed **2 duplicates**, **3 duplicates**, and **6 duplicates** across different requests with the identical prompt. - All duplicates point to the same generated image (verified by comparing base64 data and file URLs in the database). Querying the chat data via `/api/v1/chats/{id}` confirms that `history.messages[messageId].files` contains duplicate entries. Example from one request: ```json "files": [ {"type": "image", "url": "/api/v1/files/b7041e54-2262-4813-96d3-8ff44d34e512/content"}, {"type": "image", "url": "/api/v1/files/b7041e54-2262-4813-96d3-8ff44d34e512/content"} ] ``` The exact same file URL appears multiple times. The duplicates are persisted in the database — reloading the page still shows the same number of duplicate images. ### Steps to Reproduce 1. Install Open WebUI v0.8.5 (Docker or pip). 2. Configure an OpenRouter connection with a model that supports both **thinking/reasoning** and **image generation** (e.g., `google/gemini-3-pro-image-preview`). 3. Start a **new chat** and select the model. 4. Send a prompt that triggers image generation, e.g.: `A giraffe with a hilariously long neck` 5. **Do not interact with the UI** — just wait for the response to complete. 6. Observe that 2 or more identical images are displayed in the response. 7. Verify via API: `GET /api/v1/chats/{chat_id}` → check `history.messages[assistantMessageId].files` — it contains duplicate entries with the same URL. ### Logs & Screenshots **Screenshot showing 3 identical images in a single response:** <img width="1920" height="948" alt="Image" src="https://github.com/user-attachments/assets/856c3fcc-d584-42a0-a477-c83ff808a790" /> **No browser console errors** — only a tiptap warning unrelated to this issue: ``` [tiptap warn]: Duplicate extension names found: [...] ``` **Database evidence** (from `/api/v1/chats/{id}` response): - Request 1: `message.files` contains **3 entries** (2 identical + 1 with slightly different encoding) - Request 2: `message.files` contains **2 entries** (same file URL twice) - Request 3: `message.files` contains **6 entries** (4 of type A + 2 of type B, all visually identical) ### Additional Information - This issue was previously reported in #19518 (closed 2025-11-26 as COMPLETED) but remains unfixed. - The image handling in streaming deltas was introduced in PR #19073 (commit 31dc97b68, 2025-11-19). The latest `dev` branch (f5bf2a2ed) still contains the same code path without changes to address duplication. - The model used for testing: `google/gemini-3-pro-image-preview` via OpenRouter (called "Nano Banana Pro" locally). The model supports extended thinking (reasoning) and native image generation. - The duplication count is non-deterministic and does not correlate with user interaction (e.g., toggling the thinking/reasoning collapsible block does not affect the count).
Author
Owner

@Classic298 commented on GitHub (Feb 28, 2026):

I tried to reproduce this via openrouter but can't reproduce it. I tried gemini 3 pro image preview and gemini 2.5 flash image. I cannot reproduce it.

As stated in the other duplicate issues - it must be reproducible.

<!-- gh-comment-id:3976729557 --> @Classic298 commented on GitHub (Feb 28, 2026): I tried to reproduce this via openrouter but can't reproduce it. I tried gemini 3 pro image preview and gemini 2.5 flash image. I cannot reproduce it. As stated in the other duplicate issues - it must be reproducible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#58291