Issue: imageSize parameter ignored for image-to-image workflows
I’m experiencing an issue where the Gemini 3 Pro Image API (gemini-3-pro-image-preview) ignores the imageSize: '2K' parameter when performing image editing or upscaling with reference images, despite the configuration being correct according to the official documentation.
Expected Behavior
When using imageConfig.imageSize: '2K' with reference images, the output should be 2048×2048 pixels (for 1:1 aspect ratio).
Actual Behavior
The API returns 1024×1024 pixel images, completely ignoring the imageSize parameter.
Configuration Used
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
// Reference image upscaling workflow
const contents = [
{
inlineData: {
mimeType: "image/jpeg",
data: base64SourceImage // 1K source image
}
},
{
inlineData: {
mimeType: "image/png",
data: base64CanvasTemplate // 2K transparent canvas (2048×2048)
}
},
{
text: "Redraw the content from image 1 at the resolution of image 2 (2K)."
}
];
const response = await ai.models.generateContent({
model: 'gemini-3-pro-image-preview',
contents: contents,
config: {
responseModalities: ['TEXT', 'IMAGE'],
imageConfig: {
aspectRatio: '1:1',
imageSize: '2K' // ← This is being IGNORED
}
}
});
// Result: Image dimensions are 1024×1024 instead of 2048×2048
Debug Information
Request Configuration (verified via console.log):
{
"responseModalities": ["TEXT", "IMAGE"],
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "2K"
}
}
Contents Array:
- Length: 3 (2 images + 1 text prompt)
- Structure: Flat array format (not nested in
parts) - Format: Correct according to official documentation
Response:
- Image dimensions: 1024×1024
- Expected: 2048×2048
- Format: JPEG
- No error messages or warnings
Tested Scenarios
DOESN’T WORK: Text-to-image generation with imageSize: '2K'
// Simple test: text-only generation
const response = await ai.models.generateContent({
model: 'gemini-3-pro-image-preview',
contents: "A simple red square on white background",
config: {
responseModalities: ['TEXT', 'IMAGE'],
imageConfig: {
aspectRatio: '1:1',
imageSize: '2K' // ← IGNORED - Returns 1408×768 instead of 2048×2048
}
}
});
DOESN’T WORK: Image-to-image (reference-based upscaling/editing) with imageSize: '2K'
// This ignores imageSize and returns 1K images
const response = await ai.models.generateContent({
model: 'gemini-3-pro-image-preview',
contents: [
{ inlineData: { mimeType: "image/jpeg", data: sourceImage } },
{ text: "Upscale this image to 2K" }
],
config: {
responseModalities: ['TEXT', 'IMAGE'],
imageConfig: {
aspectRatio: '1:1',
imageSize: '2K' // ← IGNORED when reference images are present
}
}
});
Environment Details
- SDK:
@google/genai(latest version, Nov 2025) - Model:
gemini-3-pro-image-preview - Platform: Node.js
- Use Case: Product image upscaling (1K → 2K)
Questions
-
Is the
imageSizeparameter functional at all? Our tests show it’s completely ignored for both text-to-image AND image-to-image workflows in the Node.js SDK. -
Does it work in Python or other SDKs? Is this specific to
@google/genai? -
Is this specific to the
-previewmodel? Would the production model support this parameter? -
How do we actually generate 2K images? The documentation advertises 2K/4K generation but provides no working method to achieve it.
What I’ve Already Tried
Verified uppercase ‘K’ in imageSize: '2K'(not lowercase)
Tried both flat array and multi-turn conversation formats
Used responseModalities: ['TEXT', 'IMAGE'](not just['IMAGE'])
Verified config structure matches official documentation examples
Tested with different aspect ratios (1:1, 4:3, 16:9) - same issue
Added explicit “2K resolution” instructions in the text prompt - still ignored
Checked response for errors/warnings - none found
Expected Documentation Reference
The official documentation at https://ai.google.dev/gemini-api/docs/image-generation shows examples of:
- Text-to-image generation with
imageSize: '2K'
- Multi-image composition with up to 14 reference images

- BUT: No example combining reference images +
imageSizeparameter
Impact
This limitation prevents using Gemini 3 Pro Image for high-quality product image upscaling workflows, which is a significant use case for e-commerce applications.
Request
Can anyone confirm if this is expected behavior or a bug? If it’s a limitation, is there a recommended approach for achieving 2K output when working with reference images?
Thank you for any insights or workarounds!