#Gemini 2.5 Flash Image Preview - Multi-turn image editing fails

7 messages · Page 1 of 1 (latest)

pseudo lodge
#

Hi, I'm having an issue with multi-turn image editing on google/gemini-2.5-flash-image-preview.

  • The first request to generate an image works correctly, even with stream: true.
  • The second request, which includes the history of the first generated image for editing, fails to return a new image. The stream just ends without an image.

Here is the messages structure for my failing (second) request. Is this the correct format?

[
    {
      "role": "user",
      "content": "Draw a cat"
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "image_url",
          "image_url": {
            "url": "<URL_of_the_first_generated_image>"
          }
        }
      ]
    },
    {
      "role": "user",
      "content": "Now, change it to a 3D style"
    }
]

Is this a known issue, or am I formatting the assistant message history incorrectly for your API? Thanks.

hallow summitBOT
#

I'm an AI assistant - my answers may be incorrect and I cannot see screenshots. Please verify information with the OpenRouter docs.

I don't have specific documentation confirming multi-turn image editing support or the required message format for google/gemini-2.5-flash-image-preview. The available documentation for Gemini 2.5 Flash focuses on advanced reasoning, coding, mathematics, and scientific tasks, and does not explicitly address multi-turn image editing or the handling of prior generated images in the chat history. Please verify this behavior with the mods or check the Gemini 2.5 Flash Preview page and the OpenRouter docs directly for the most accurate and current information.

-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding.

The author you are looking for could not be found.

Gemini 2.5 Flash is Google's state-of-the-art workhorse model, specifically designed for advanced reasoning, coding, mathematics, and scientific tasks. Run Gemini 2.5 Flash Preview 04-17 with API

pseudo lodge
#

I've confirmed a bug in the response format for multi-turn image editing with the google/gemini-2.5-flash-image-preview model.

My request to edit an image is structured correctly with the full message history (user -> assistant with image_url -> new user prompt).

The API responds with finish_reason: "stop", but the message.content in the response is just a string containing a literal <image> placeholder, instead of a proper content array with the image_url object.

pseudo lodge
#

<@&1384697330254610442>

hollow minnow
#

@pseudo lodge 你的这个问题解决了吗?

pseudo lodge
hollow minnow
#

@pseudo lodge 有没有可能是bug 或xxx 的,多试几次就有图片出来了,今天我每失败个几次就有几次成功。