Skip to main content

AI Image Generation

Text to image​

Describe the image in prompt and choose an image model. Generated images are PNG files.

{
"asset": {
"type": "image",
"prompt": "Aerial photograph of Sydney Harbour at dusk, city lights reflecting on the water",
"model": "nano-banana-2",
"options": {
"aspectRatio": "16:9",
"resolution": "2K"
}
},
"start": 0,
"length": 5
}

Editing images​

The edit models take one or more existing images in options.imageUrls and change them as the prompt describes. Use them to retouch a product shot, restyle a photo or combine several images into one. Say what to change and what to keep.

{
"asset": {
"type": "image",
"prompt": "Place the handbag from the first image on the marble bench from the second image. Keep the handbag's colour and stitching exactly as they are.",
"model": "nano-banana-2-edit",
"options": {
"imageUrls": [
"https://example.com/images/handbag.jpg",
"https://example.com/images/marble-bench.jpg"
],
"aspectRatio": "16:9"
}
},
"start": 0,
"length": 5
}

imageUrls must be public HTTP or HTTPS URLs. nano-banana-2-edit takes up to 14 images and gpt-image-2.5-sunburst-edit takes up to 16, in order.

Models​

ModelUse it forResolution
nano-banana-2The default. Fast, with accurate text and coherent compositions.0.5K, 1K (default), 2K, 4K
nano-banana-2-editEditing and combining images with Nano Banana 2.0.5K, 1K (default), 2K, 4K
nano-banana-proDense compositions with many instructions, at high resolution.1K (default), 2K, 4K
gpt-image-2.5-sunburstHighly detailed images that follow complex prompts closely. Slower.1K (default), 2K, 4K
gpt-image-2.5-sunburst-editPrecise edits with up to 16 references. Slower.1K (default), 2K, 4K
flux-schnellQuick illustrations and drafts. Takes no options.Fixed

Options​

OptionModelsValues
aspectRatioNano Banana 2 and its edit modelauto (default), 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 4:1, 1:4, 8:1, 1:8
Nano Banana Proauto, 21:9, 16:9, 3:2, 4:3, 5:4, 1:1 (default), 4:5, 3:4, 2:3, 9:16
GPT Image models21:9, 16:9 (default), 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16
resolutionAll except flux-schnellSee the table above.
imageUrlsEdit modelsThe images to edit. Required.
seedNano Banana modelsAn integer. The same seed and prompt reproduce a result.
systemPromptNano Banana modelsStanding instructions sent with the prompt, up to 2,000 characters.

GET /models/{id} returns the full option schema for a model.

Writing image prompts​

This guidance is for the Nano Banana models.

  • Write plain sentences. Describe the scene as you would to a photographer. Shot type, camera angle, lighting, lens and focal length all work. Comma-separated tags and quality boosters like "8k" don't help.
  • There is no negative prompt. Say what you want instead: "an empty desk", not "no clutter".
  • Quote text that must appear, and describe the font in plain words: the text "Grand Opening" in a clean, bold, sans-serif.
  • Use Pro for hard compositions, not for better images in general. Nano Banana 2 matches or beats Pro on most images at about half the price.

For copy that must be spelled exactly, run to several lines or change with merge fields, generate a plain background and put a rich text asset over it. Real fonts are always spelled correctly, stay sharp at any size and can be reworded without generating again.

Match aspectRatio to the clip it fills. An image that will become the start of a generated video should be larger than the video: use 2K for a 720p or 1080p video.