Generate images based on input images using Gemini Flash Image model
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
contents | array | ✅ Yes | - | An array of content objects representing the generation prompt and input image. The role of the message sender. Typically "user". Optional for single-turn requests. |
parts | array | ✅ Yes | - | An array of parts that make up the message content, including text prompt and input image. Text prompt for image transformation. |
inline_data | object | ❌ No | - | Input image data in base64 format. The MIME type of the image (e.g., "image/jpeg", "image/png"). |
data | string | ✅ Yes | - | Base64-encoded image data. |
generationConfig | object | ❌ No | - | Configuration for the image generation behavior. Response modalities. For image generation, use ["TEXT", "IMAGE"]. |
imageConfig | object | ❌ No | - | Image-specific configuration. Aspect ratio for the generated image. Examples: "16:9", "1:1", "9:16". |