https://llm.ai-nebula.com/v1/images/generationsBearer sk-xxxxxxxxxx| Parameter Name | Type | Required | Description | Example Value |
|---|---|---|---|---|
| model | string | Yes | Model Name | gemini-2.5-flash-image |
| prompt | string | No* | Text prompt | "A cute orange kitten" |
| contents | array | No* | Multimodal content (supports conversational context and image-to-image) | See examples |
| response_format | string | No | Response format: b64_json | b64_json |
| size | string | No | Image aspect ratio (ratio or pixels) | "16:9" or "1792x1024" |
prompt or contents; at least one must be provided."image": "https://example.com/image.jpg""image": "data:image/png;base64,iVBORw0..."size parameter, supporting two formats:{
"size": "16:9"
}{
"size": "1792x1024" // Automatically converted to 16:9
}| Aspect Ratio | Pixel Dimensions | Usage Scenarios |
|---|---|---|
| 1:1 | 1024x1024 | Square images, avatars, social media |
| 3:2 | 1536x1024 | Standard photography ratio |
| 2:3 | 1024x1536 | Vertical posters, phone wallpapers |
| 3:4 | 1536x2048 | Vertical photos |
| 4:3 | 2048x1536 | Traditional display ratio |
| 4:5 | 1024x1280 | Instagram vertical |
| 5:4 | 1280x1024 | Traditional display ratio |
| 9:16 | 1024x1792 | Mobile vertical screen, short video covers |
| 16:9 | 1792x1024 | Widescreen, video covers, desktop wallpapers |
| 21:9 | 1024x2176 | Ultrawide screen |
response_format is set to b64_json, the image data is in the data[].b64_json field.b64_json format; url format is not supported.{
"code": 200,
"msg": "Operation successful",
"data": {
"data": [
{
"url": "",
"b64_json": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQA[base64 data truncated]",
"revised_prompt": ""
}
],
"created": 1757320007
}
}{
"code": 400,
"msg": "Invalid parameter: Unsupported aspect ratio",
"data": null
}400: Parameter Error (e.g., incorrect model name, invalid aspect ratio format).401: Authentication Failed (Invalid or expired API key).429: Rate Limit Exceeded (Requesting too frequently).500: Internal Server Error.| Effect | Prompt Example |
|---|---|
| ❌ Blurry | "Mix these two images" |
| ✅ Clear | "Apply the watercolor style of the first image to the cityscape of the second image, keeping the architectural details but re-rendering with soft colors and brushstrokes." |
| ❌ Blurry | "Combine these images into one" |
| ✅ Clear | "Create a product poster: adopt the minimalist color scheme of the first image, the minimalist lines of the second image, and the white space layout style of the third image." |
contents conversation array, include the size parameter with every request. The system will apply the specified aspect ratio to the current request.data:image/png;base64,iVBORw0....image/png, image/jpeg, image/webp.image objects in the contents[].parts array and explicitly state how to process these images in the text. See section 3.3 for multi-image examples.| Parameter | Value |
|---|---|
| Model Name | gemini-2.5-flash-image |
| Supported Formats | PNG, JPEG, JPG, WEBP |
| Max Size | 7MB (per image) |
| Supported Aspect Ratios | 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
| Image Input | URL or Base64 |
| Multi-Image Input | Supports inputting 2-5 images simultaneously |
| Response Format | b64_json |
| Function | Description | Example Section |
|---|---|---|
| Text-to-Image | Generate images from pure text descriptions | 2.1-2.4 |
| Image-to-Image | Generate new images from single image + text | 3.1-3.2 |
| Multi-Image-to-Image | Generate from fusing 2-5 images | 3.3 |
| Conversational Generation | Continuous image modification in multi-turn chat | 3.4 |
| Ratio | Pixels | Scenario |
|---|---|---|
| 1:1 | 1024x1024 | Social media, avatars |
| 16:9 | 1792x1024 | Video covers, landscape wallpapers |
| 9:16 | 1024x1792 | Short videos, phone wallpapers |
| 21:9 | 1024x2176 | Ultrawide panoramas |
| Scenario | Image Count | Prompt Example |
|---|---|---|
| Style Transfer | 2 images | "Apply the oil painting style of the first image to the content of the second image" |
| Element Combination | 2-3 images | "Use the sky from image 1 + building from image 2 + plants from image 3" |
| Product Design | 3-4 images | "Design a coffee cup referencing these images: color from 1st + lines from 2nd + handle from 3rd" |
| Scene Fusion | 2 images | "Fuse the characteristics of these two scenes to create a new environment" |