Overview
Nano-Banana Text-to-Image is Google’s lightweight yet powerful AI image generation model, built for creators who need fast, high-quality visuals from simple text prompts. It transforms words into expressive, realistic images with remarkable clarity, composition, and style diversity — all within seconds.- Text-to-Image: Generate high-quality images from simple or complex text descriptions.
Supported inputs & outputs :
Inputs: Text Outputs: Text and imageAuthentication
This endpoint requires authentication using a Bearer token.Your API key in the format:
YOUR_API_KEYRequest Body
Prompt parameter
Aspect Ratio parameter 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. default 1:1
Output Format parameter png, jpeg Default png
If set to true, the function will wait for the result to be generated and uploaded before returning the response. It allows you to get the result directly in the response. This property is only available through the API.
If enabled, the output will be encoded into a BASE64 string instead of a URL. This property is only available through the API.
Text-to-Image
Query Result
Aspect ratio
The model defaults to generates 1:1 squares. The different ratios available and the size of the image generated are listed in this table:| 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 |
Response
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Array of URLs to the generated content (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.urls.get | string | URL to retrieve the prediction result |
| data.has_nsfw_contents | array | Array of boolean values indicating NSFW detection for each output |
| data.status | string | Status of the task: created, processing, completed, or failed |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |

