[GH-ISSUE #19522] feat: open router image create/edit #34441

Closed
opened 2026-04-25 08:26:36 -05:00 by GiteaMirror · 13 comments
Owner

Originally created by @davidpede on GitHub (Nov 26, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19522

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.6.40

Ollama Version (if applicable)

No response

Operating System

Ubuntu

Browser (if applicable)

No response

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

I am direct chatting with model 'gemini-3-pro-image-preview' and 'gemini-2.5-flash-image' (provided by OpenRouter). I'm not using the in-built Image Generation/Editing feature.

  1. Images generated by a prompt to the model should be used when asking for edits.
  2. When uploading an image to the chat and asking for edits it works correctly the only the first response.
  3. When asking for another edit it should use the model generated image returned in the last model response

Actual Behavior

  1. Images generated by a prompt to the model are not used when asking for edits. A new image is returned.
  2. When uploading an image to the chat and asking for multiple edits, it always uses the uploaded image never the edited image returned in the last response.

Steps to Reproduce

Set the following in docker environment:
CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE=10485760
ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION=true

  1. Ask 'gemini-3-pro-image-preview' or 'gemini-2.5-flash-image' (via openrouter) for an image
  2. Ask for an edit and the model returns a new image

  1. Upload an image to a chat with 'gemini-3-pro-image-preview' or 'gemini-2.5-flash-image' (via openrouter)
  2. Ask for an edit and the model returns the correctly edited image
  3. Ask for different edit and the uploaded image is edited again, not the last returned image from the model

Logs & Screenshots

Model generated image:

Image

Uploaded image:

Image

Additional Information

Looks possible that model generated images in the chat are not being sent with subsequent edit prompts

Originally created by @davidpede on GitHub (Nov 26, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/19522 ### 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.6.40 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu ### Browser (if applicable) _No response_ ### 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 I am direct chatting with model 'gemini-3-pro-image-preview' and 'gemini-2.5-flash-image' (provided by OpenRouter). I'm not using the in-built Image Generation/Editing feature. 1. Images generated by a prompt to the model should be used when asking for edits. 2. When uploading an image to the chat and asking for edits it works correctly the only the **first** response. 3. When asking for another edit it should use the model generated image returned in the last model response ### Actual Behavior 1. Images generated by a prompt to the model are not used when asking for edits. A new image is returned. 2. When uploading an image to the chat and asking for multiple edits, it always uses the uploaded image never the edited image returned in the last response. ### Steps to Reproduce Set the following in docker environment: `CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE=10485760` `ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION=true` 1. Ask 'gemini-3-pro-image-preview' or 'gemini-2.5-flash-image' (via openrouter) for an image 2. Ask for an edit and the model returns a new image --- 1. Upload an image to a chat with 'gemini-3-pro-image-preview' or 'gemini-2.5-flash-image' (via openrouter) 2. Ask for an edit and the model returns the correctly edited image 3. Ask for different edit and the uploaded image is edited again, not the last returned image from the model ### Logs & Screenshots Model generated image: <img width="577" height="898" alt="Image" src="https://github.com/user-attachments/assets/890c321d-881e-4403-a045-f667e40abe90" /> Uploaded image: <img width="578" height="906" alt="Image" src="https://github.com/user-attachments/assets/7efc6cbe-6687-40a5-8eb3-23b0f4cbc43a" /> ### Additional Information Looks possible that model generated images in the chat are not being sent with subsequent edit prompts
GiteaMirror added the bug label 2026-04-25 08:26:36 -05:00
Author
Owner

@Classic298 commented on GitHub (Nov 26, 2025):

@ShirasawaSama perhaps one for you when you have time

<!-- gh-comment-id:3582012040 --> @Classic298 commented on GitHub (Nov 26, 2025): @ShirasawaSama perhaps one for you when you have time
Author
Owner

@tjbck commented on GitHub (Nov 26, 2025):

This isn't officially supported, with that being said we're open to reviewing PRs.

<!-- gh-comment-id:3583366596 --> @tjbck commented on GitHub (Nov 26, 2025): This isn't officially supported, with that being said we're open to reviewing PRs.
Author
Owner

@tjbck commented on GitHub (Nov 27, 2025):

#19518

<!-- gh-comment-id:3584064513 --> @tjbck commented on GitHub (Nov 27, 2025): #19518
Author
Owner

@wsomm commented on GitHub (Nov 28, 2025):

I ran into the same problem. I want to reserve the built-in image generation for local models with ComfyUI, but still offer Nano Banana as commercial image generation—and I have exactly the same issue. (BTW: I run Nano Banana directly via my GeminiAI account using litellm).

Editing only works if I have uploaded an image beforehand.

The cause also seems clear: The generated image is removed at some point in OWUI from the data of the assistant part of the message and is no longer available in the "chat chain" for subsequent requests.

The solution would be to leave the entire image:base64 part in the message instead of removing it. However, I lack the skills to submit a PR for this.

<!-- gh-comment-id:3588324731 --> @wsomm commented on GitHub (Nov 28, 2025): I ran into the same problem. I want to reserve the built-in image generation for local models with ComfyUI, but still offer Nano Banana as commercial image generation—and I have exactly the same issue. (BTW: I run Nano Banana directly via my GeminiAI account using litellm). Editing only works if I have uploaded an image beforehand. The cause also seems clear: The generated image is removed at some point in OWUI from the data of the assistant part of the message and is no longer available in the "chat chain" for subsequent requests. The solution would be to leave the entire image:base64 part in the message instead of removing it. However, I lack the skills to submit a PR for this.
Author
Owner

@siavashvj commented on GitHub (Jan 15, 2026):

I remember reading that this was fixed in one of the latest versions, but since this is still open it is still an issue right?

I'm having same experience on 0.7.2, direct connection using GPT Image 1.5.

Ping @Classic298

Edit: Comment on wrong issue, my bad.

<!-- gh-comment-id:3753850411 --> @siavashvj commented on GitHub (Jan 15, 2026): I remember reading that this was fixed in one of the latest versions, but since this is still open it is still an issue right? I'm having same experience on 0.7.2, ~direct connection~ using GPT Image 1.5. Ping @Classic298 Edit: Comment on wrong issue, my bad.
Author
Owner

@Classic298 commented on GitHub (Jan 15, 2026):

@siavashvj
this is still open because tim said he's open for PRs to add image generation support in the Admin panel > images setting, not because it doesnt work.

You CAN add models for image generation as normal models and configure the chunk size accordingly and it will work - semi work.

Wait wait - Direct connection to GPT Image 1.5? Thats not how you configure image generation for OpenAI models. Please read the docs.

<!-- gh-comment-id:3753885188 --> @Classic298 commented on GitHub (Jan 15, 2026): @siavashvj this is still open because tim said he's open for PRs to add image generation support in the Admin panel > images setting, not because it doesnt work. You CAN add models for image generation as normal models and configure the chunk size accordingly and it will work - semi work. Wait wait - Direct connection to GPT Image 1.5? Thats not how you configure image generation for OpenAI models. Please read the docs.
Author
Owner

@wsomm commented on GitHub (Jan 15, 2026):

What works:
Defining "Create image" / "Edit image" in the settings with Google Nano Banana.
You switch the tool on and can create and edit any image.

What doesn’t work:
Having a model Nano Banana.
You can create an image OR edit any image that is loaded in the chat interface beforehand.
You cannot edit (“refine”) any already created image.

As a great number of my users are non‑technical, even the simple switch and explaining which models they can use, is asking too much.

Summary: It doesn’t work with a model in a native way, but it is not a blocking issue in any kind.

<!-- gh-comment-id:3753989486 --> @wsomm commented on GitHub (Jan 15, 2026): What works: Defining "Create image" / "Edit image" in the settings with Google Nano Banana. You switch the tool on and can create and edit any image. What doesn’t work: Having a model Nano Banana. You can create an image OR edit any image that is loaded in the chat interface beforehand. You cannot edit (“refine”) any already created image. As a great number of my users are non‑technical, even the simple switch and explaining which models they can use, is asking too much. Summary: It doesn’t work with a model in a native way, but it is not a blocking issue in any kind.
Author
Owner

@siavashvj commented on GitHub (Jan 15, 2026):

@wsomm I've tested this extensively now in 0.7.2 (GPT Image 1.5 for both generating and editing), and my findings are that it works when using the new Builtin Tools (native function calling). Using the legacy Image feature button, however, does not work or semi-works at best.

What doesn’t work:
Having a model Nano Banana.
You can create an image OR edit any image that is loaded in the chat interface beforehand.
You cannot edit (“refine”) any already created image.

So this actually do work as it should (if I understand you correctly) with native function calling, in my testings.

Process:

  1. Generate an image (image with a horse, banana and toy car)
  2. Edit the image (remove the banana)
  3. Make another edit to the new image (remove the toy car)

= Third image is an image with only the horse.

<!-- gh-comment-id:3754380020 --> @siavashvj commented on GitHub (Jan 15, 2026): @wsomm I've tested this extensively now in 0.7.2 (GPT Image 1.5 for both generating and editing), and my findings are that it works when using the new Builtin Tools (native function calling). Using the legacy Image feature button, however, does not work or semi-works at best. > What doesn’t work: > Having a model Nano Banana. > You can create an image OR edit any image that is loaded in the chat interface beforehand. > You cannot edit (“refine”) any already created image. So this actually do work as it should (if I understand you correctly) with native function calling, in my testings. Process: 1. Generate an image (image with a horse, banana and toy car) 2. Edit the image (remove the banana) 3. Make another edit to the new image (remove the toy car) = Third image is an image with only the horse.
Author
Owner

@vanmilleru commented on GitHub (Apr 4, 2026):

Can a plugin be made for supporting open-router-like responses?

<!-- gh-comment-id:4186940663 --> @vanmilleru commented on GitHub (Apr 4, 2026): Can a [plugin](https://github.com/open-webui/open-webui/discussions/20388) be made for supporting open-router-like responses?
Author
Owner

@Classic298 commented on GitHub (Apr 15, 2026):

Expected Behavior
I am direct chatting with model 'gemini-3-pro-image-preview' and 'gemini-2.5-flash-image' (provided by OpenRouter). I'm not using the in-built Image Generation/Editing feature.

Images generated by a prompt to the model should be used when asking for edits.
When uploading an image to the chat and asking for edits it works correctly the only the first response.
When asking for another edit it should use the model generated image returned in the last model response

When directly chatting with the model, the behaviour is model related. The model decides which image to use or what to do.

If native tool calling is used with configured image gen provider on the other hand, the chat model decides whether to call generate_image tool or edit_image tool and provides the relative image URL to specify which image(s) to edit.

for direct integration it's up to the model.

There was an issue in the past, now months ago, where the model wasn't able to see it's own generated images but i think that's long been fixed and it works for me locally on 0.8.12 when i try to edit images with openrouter via gemini models

<!-- gh-comment-id:4254905347 --> @Classic298 commented on GitHub (Apr 15, 2026): > Expected Behavior > I am direct chatting with model 'gemini-3-pro-image-preview' and 'gemini-2.5-flash-image' (provided by OpenRouter). I'm not using the in-built Image Generation/Editing feature. > > Images generated by a prompt to the model should be used when asking for edits. > When uploading an image to the chat and asking for edits it works correctly the only the first response. > When asking for another edit it should use the model generated image returned in the last model response When directly chatting with the model, the behaviour is model related. The model decides which image to use or what to do. If native tool calling is used with configured image gen provider on the other hand, the chat model decides whether to call generate_image tool or edit_image tool and provides the relative image URL to specify which image(s) to edit. for direct integration it's up to the model. There was an issue in the past, now months ago, where the model wasn't able to see it's own generated images but i think that's long been fixed and it works for me locally on 0.8.12 when i try to edit images with openrouter via gemini models
Author
Owner

@wsomm commented on GitHub (Apr 15, 2026):

It works with a model and the built-in tools.

It doesn't work directly with Google Nano Banana without built-in tools, which it should in my opinion.

<!-- gh-comment-id:4254990921 --> @wsomm commented on GitHub (Apr 15, 2026): It works with a model and the built-in tools. It doesn't work directly with Google Nano Banana _without_ built-in tools, which it should in my opinion.
Author
Owner

@Classic298 commented on GitHub (Apr 15, 2026):

Only built in tools is supported, but yes it should also work directly with the model itself as well.

Can't reproduce though works from my testing

<!-- gh-comment-id:4255001730 --> @Classic298 commented on GitHub (Apr 15, 2026): Only built in tools is supported, but yes it should also work directly with the model itself as well. Can't reproduce though works from my testing
Author
Owner

@wsomm commented on GitHub (Apr 15, 2026):

For me the work around with built-in tools is sufficient, so why bother...

(But it doesn't work directly in Nano Banana..., Gemini API Key.)

<!-- gh-comment-id:4255047350 --> @wsomm commented on GitHub (Apr 15, 2026): For me the work around with built-in tools is sufficient, so why bother... (But it doesn't work directly in Nano Banana..., Gemini API Key.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#34441