imageSize: "512px" not applied in gemini-3.1-flash-image-preview (always returns ~1K resolution)

I’m using gemini-3.1-flash-image-preview with the following configuration:

const response = await genAI.models.generateContent({
  model: "gemini-3.1-flash-image-preview",
  contents: parts,
  config: {
    responseModalities: ["TEXT", "IMAGE"],
    imageConfig: {
      aspectRatio: "16:9",
      imageSize: "512px",
    },
  },
});

However, regardless of setting imageSize: "512px" (0.5K), the generated images are always returned in approximately 1K resolution.

Questions

  1. Is imageSize currently supported in gemini-3.1-flash-image-preview?

  2. Is "512px" a valid value, or is a different format required? (I also tried “0.5K”)

  3. Is this a known issue or intentional behavior (e.g., minimum resolution enforced)?

  4. Is there any workaround to force lower-resolution output?

Would appreciate clarification from the team or anyone who has encountered this.

Thanks.

2 Likes

I have observed this issue as well.

I have observed this issue as well.

Same thing happened to me

same here wish it was working