Image Edit
| Parameter | Type | Required | Default | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contents | array | ✅ Yes | - | The prompt for the generation. | ||||||||||||||||||||||||||||||||||||
inline_data | object | ✅ Yes | - | Supported MIME image/png, image/jpeg, image/webp | ||||||||||||||||||||||||||||||||||||
data | string | ✅ Yes | - | Maximum image size: 7 MB | ||||||||||||||||||||||||||||||||||||
generationConfig | object | ❌ No | - | The model defaults to returning text and image responses (['Text', 'Image']). You can configure the response to return only images without text using ( ['Image']). | ||||||||||||||||||||||||||||||||||||
imageConfig | object | ❌ No | - | Supported aspect ratios: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | Aspect ratio | Resolution | ------------ | ---------- | 1:1 | 1024x1024 | 2:3 | 832x1248 | 3:2 | 1248x832 | 3:4 | 864x1184 | 4:3 | 1184x864 | 4:5 | 896x1152 | 5:4 | 1152x896 | 9:16 | 768x1344 | 16:9 | 1344x768 | 21:9 | 1536x672 |
image/png, image/jpeg, image/webp
config field of generate_content calls.
response_modalities=['Text', 'Image']). You can configure the response to return only images without text using response_modalities=['Image'].
aspect_ratio field under image_config in the response request: The different ratios available and the size of the image generated are listed in this table:
| Input | Output |
|---|---|
![]() | ![]() |
| A photorealistic picture of a fluffy ginger cat… | Using the provided image of my cat, please add a small, knitted wizard hat… |
| Input1 | Input2 | Output |
|---|---|---|
![]() | ![]() | ![]() |
| A professionally shot photo of a blue floral summer dress… | Full-body shot of a woman with her hair in a bun… | Create a professional e-commerce fashion photo… |
wide-angle shot, macro shot, low-angle perspective.