[GH-ISSUE #19750] issue: Image Edit does not distinguish between User and Assistant images #57649

Closed
opened 2026-05-05 21:17:58 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @eml-henn on GitHub (Dec 4, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19750

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

6.40

Ollama Version (if applicable)

No response

Operating System

Debian

Browser (if applicable)

Firefox

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

User prompts for image generation or uploads an image and prompts for an edit.
Assistant generates an image
User uploads an image as a reference to edit the previously generated image.
Assistant generates a new image based on the previously generated image AND the new reference image

Actual Behavior

User prompts for image generation or uploads an image and prompts for an edit.
Assistant generates an image
User uploads an image as a reference to edit the previously generated image.
Assistant generates a new image based ONLY on the new reference image

Steps to Reproduce

tested with gpt-image-1 and nano banana.

turn on image generation and image editing
create a new chat
turn on the image creation extension
input your prompt, or upload reference images and input your prompt
generate an image
upload a reference image and input a prompt to edit

Image

Logs & Screenshots

Image Image

Additional Information

The issue is with the get last images function in middleware.py

def get_last_images(message_list):
images = []
for message in reversed(message_list):
images_flag = False
for file in message.get("files", []):
if file.get("type") == "image":
images.append(file.get("url"))
images_flag = True

    if images_flag:
        break

return images

as soon as it parses the most recent user message with one or more rerefence images, it stops.

I am testing with a minimal fix which runs a function for get_last_user_images and a separate get_last_assistang_images. The rest of the logic would otherwise remain the same - if images are found, they are sent to the image edit endpoint. If this method sounds acceptable, I´d go on with testing and send a PR.

Originally created by @eml-henn on GitHub (Dec 4, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/19750 ### 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 6.40 ### Ollama Version (if applicable) _No response_ ### Operating System Debian ### Browser (if applicable) Firefox ### 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 User prompts for image generation or uploads an image and prompts for an edit. Assistant generates an image User uploads an image as a reference to edit the previously generated image. Assistant generates a new image based on the previously generated image AND the new reference image ### Actual Behavior User prompts for image generation or uploads an image and prompts for an edit. Assistant generates an image User uploads an image as a reference to edit the previously generated image. Assistant generates a new image based ONLY on the new reference image ### Steps to Reproduce tested with gpt-image-1 and nano banana. turn on image generation and image editing create a new chat turn on the image creation extension input your prompt, or upload reference images and input your prompt generate an image upload a reference image and input a prompt to edit <img width="805" height="562" alt="Image" src="https://github.com/user-attachments/assets/dd6a0539-8a12-4771-907d-4f6aebc4c3b4" /> ### Logs & Screenshots <img width="706" height="802" alt="Image" src="https://github.com/user-attachments/assets/31c15031-9a69-4f51-b389-0a992f77fd29" /> <img width="646" height="814" alt="Image" src="https://github.com/user-attachments/assets/1335052b-fac9-407a-bc8f-17badd9c841b" /> ### Additional Information The issue is with the get last images function in middleware.py def get_last_images(message_list): images = [] for message in reversed(message_list): images_flag = False for file in message.get("files", []): if file.get("type") == "image": images.append(file.get("url")) images_flag = True if images_flag: break return images as soon as it parses the most recent user message with one or more rerefence images, it stops. I am testing with a minimal fix which runs a function for get_last_user_images and a separate get_last_assistang_images. The rest of the logic would otherwise remain the same - if images are found, they are sent to the image edit endpoint. If this method sounds acceptable, I´d go on with testing and send a PR.
GiteaMirror added the bugconfirmed issue labels 2026-05-05 21:17:58 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Dec 4, 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:

  1. #18995 issue: image generation and edition doesn’t work on temporary chats
    by futureshield • Nov 06, 2025 • bug

  2. #19393 issue: shared chats with images - images won't show
    by Classic298 • Nov 23, 2025 • bug

  3. #19702 issue: Image generation tool causes inconsistency between model response and actual generated image
    by manwallet • Dec 03, 2025 • bug

  4. #19187 issue: Image generation menu gone.
    by calebrio02 • Nov 14, 2025 • bug

  5. #19563 issue:
    by naruto7g • Nov 28, 2025 • bug

Show 5 more related issues
  1. #19019 issue: Image generation doesn't work with OpenRouter
    by vladkvit • Nov 07, 2025 • bug

  2. #19438 issue: Icon loading regression
    by JoelShepard • Nov 24, 2025 • bug

  3. #19451 issue: Images with gpt-image-1 ERROR: No connection adapters were found
    by 3keyallen3 • Nov 25, 2025 • bug

  4. #19215 issue:Server Failed opening Admin > Settings > Images Panel
    by fordinator • Nov 16, 2025 • bug

  5. #19284 issue: Need button in GUI to disable image edit
    by ALIENvsROBOT • Nov 19, 2025 • bug


💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3612095240 --> @owui-terminator[bot] commented on GitHub (Dec 4, 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: 1. [#18995](https://github.com/open-webui/open-webui/issues/18995) **issue: image generation and edition doesn’t work on temporary chats** *by futureshield • Nov 06, 2025 • `bug`* 2. [#19393](https://github.com/open-webui/open-webui/issues/19393) **issue: shared chats with images - images won't show** *by Classic298 • Nov 23, 2025 • `bug`* 3. [#19702](https://github.com/open-webui/open-webui/issues/19702) **issue: Image generation tool causes inconsistency between model response and actual generated image** *by manwallet • Dec 03, 2025 • `bug`* 4. [#19187](https://github.com/open-webui/open-webui/issues/19187) **issue: Image generation menu gone.** *by calebrio02 • Nov 14, 2025 • `bug`* 5. [#19563](https://github.com/open-webui/open-webui/issues/19563) **issue:** *by naruto7g • Nov 28, 2025 • `bug`* <details> <summary>Show 5 more related issues</summary> 6. [#19019](https://github.com/open-webui/open-webui/issues/19019) **issue: Image generation doesn't work with OpenRouter** *by vladkvit • Nov 07, 2025 • `bug`* 7. [#19438](https://github.com/open-webui/open-webui/issues/19438) **issue: Icon loading regression** *by JoelShepard • Nov 24, 2025 • `bug`* 8. [#19451](https://github.com/open-webui/open-webui/issues/19451) **issue: Images with gpt-image-1 ERROR: No connection adapters were found** *by 3keyallen3 • Nov 25, 2025 • `bug`* 9. [#19215](https://github.com/open-webui/open-webui/issues/19215) **issue:Server Failed opening Admin > Settings > Images Panel** *by fordinator • Nov 16, 2025 • `bug`* 10. [#19284](https://github.com/open-webui/open-webui/issues/19284) **issue: Need button in GUI to disable image edit** *by ALIENvsROBOT • Nov 19, 2025 • `bug`* </details> --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Author
Owner

@silentoplayz commented on GitHub (Dec 6, 2025):

This issue has been reproduced internally. so I've added the confirmed issue label.

<!-- gh-comment-id:3620592999 --> @silentoplayz commented on GitHub (Dec 6, 2025): This issue has been reproduced internally. so I've added the `confirmed issue` label.
Author
Owner

@Classic298 commented on GitHub (Dec 11, 2025):

Fixed in dev

<!-- gh-comment-id:3641031554 --> @Classic298 commented on GitHub (Dec 11, 2025): Fixed in dev
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#57649