Vertex AI Gemini 3.1 Flash Image Preview downgrades 2K/4K requests to 1K

I’m seeing what looks like a Vertex AI issue with gemini-3.1-flash-image-preview.

I send image generation requests to Vertex AI with payloads like this:

{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Editorial portrait ..."
        }
      ]
    }
  ],
  "generationConfig": {
    "maxOutputTokens": 32768,
    "temperature": 1,
    "topP": 0.95,
    "responseModalities": ["TEXT", "IMAGE"],
    "imageConfig": {
      "aspectRatio": "4:3",
      "imageSize": "4K"
    }
  },
  "safetySettings": [
    {
      "category": "HARM_CATEGORY_HATE_SPEECH",
      "threshold": "OFF"
    },
    {
      "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
      "threshold": "OFF"
    },
    {
      "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
      "threshold": "OFF"
    },
    {
      "category": "HARM_CATEGORY_HARASSMENT",
      "threshold": "OFF"
    }
  ]
}

I tested this both through my app and by replaying the same request directly to the Vertex AI generateContent endpoint outside the app.

The request clearly includes:

  • generationConfig.imageConfig.aspectRatio = "4:3"
  • generationConfig.imageConfig.imageSize = "2K" or "4K"

However, the returned image is only 1200x896, which matches the 1K output size for 4:3.

Observed behavior:

  • imageConfig.imageSize = "512px" works correctly
  • imageConfig.imageSize = "1K" works correctly
  • imageConfig.imageSize = "2K" returns 1200x896
  • imageConfig.imageSize = "4K" also returns 1200x896

This happens even in a direct raw Vertex AI HTTP request outside the app, so it does not appear to be caused by frontend logic, request-building code, storage, or display.

Additional context:

  • gemini-3-pro-image-preview honors 2K correctly in the same environment
  • this issue happens both with and without reference images
  • the request completes successfully with finishReason = "STOP"
  • in one raw replay, the response included 2 image parts and several text parts, even though the request was intended as a single image generation flow

Questions:

  • Is gemini-3.1-flash-image-preview on Vertex AI currently limited to 1K outputs in practice, even if imageConfig.imageSize accepts "2K" and "4K"?
  • Are "2K" and "4K" officially supported on the Vertex AI generateContent path for this model today?
  • Is there a known issue where higher imageConfig.imageSize values are silently downgraded instead of returning an error?
  • Is behavior different between Vertex AI Studio / UI and direct API calls for this model?

If useful, I can share:

  • exact raw request payloads
  • raw response payloads
  • measured output dimensions for each imageConfig.imageSize value
4 Likes

I am facing the exact same issue on vertex AI. If you use the Google Developer API (Google AI Studio), it works perfectly. I have vertex AI as a fallback and currently Google AI Studio API is giving 5xxa lot.

3 Likes

I implemented this as a workaround and it is working fine. Thank you for this idea!

1 Like

It’s really ridiculous. Google is trying to kill the trust of the developers.

Normally it should be other way. like gemini api as retry backoff, vertex ai as the main api. (gemini api is prototype api, vertex api is enterprise)

but probably because of the organizational problems, these two teams are not running at the same pace. (even though they release the models in both apis)

2 Likes