HomeDocsNano Banana Image API
Image APIs

Nano Banana Image API

Photoreal image generation and editing with natural language prompts, high dynamic range output, and variation control. · Updated 2025-03-18

Overview

Nano Banana is Transend's branding for Gemini 2.5 Flash image mode. It creates photorealistic renders, supports region-aware edits, and outputs PNG, WebP, or EXR for downstream workflows.

Request Body

curl -X POST "https://api.transendai.net/v1/images/nano-banana/generation" \
  -H "Authorization: Bearer $TRANSEND_API_KEY" \
  -H "Content-Type": "application/json" \
  -d '{
    "prompt": "Ultra-realistic smart thermostat on a textured concrete wall with warm morning light",
    "size": "1024x1024",
    "variations": 4,
    "style": ["photoreal", "soft-light"]
  }'
FieldDescription
promptNarrative description of the desired render.
sizeWidth × height (512–2048). Square or rectangular values supported.
variationsNumber of results (1–6).
styleOptional array of style modifiers.

Editing Existing Images

curl -X POST "https://api.transendai.net/v1/images/nano-banana/edit" \
  -H "Authorization: Bearer $TRANSEND_API_KEY" \
  -F "[email protected]" \
  -F "[email protected]" \
  -F 'payload={
    "prompt": "Replace the background with white marble and add golden light streaks.",
    "size": "1024x1024"
  }'
  • image accepts PNG or JPEG up to 20 MB.
  • mask (optional) uses white for editable regions and black for preserved pixels.

Response Example

{
  "images": [
    {
      "url": "https://edge.transendai.net/images/img_7s2m.png",
      "metadata": {
        "seed": 9823145,
        "style": ["photoreal", "soft-light"]
      }
    }
  ],
  "usage": {
    "input_pixels": 1048576,
    "output_images": 4
  }
}

Persist metadata.seed if you plan to reroll variants later.

HDR & EXR Output

Request HDR content by setting output_format:

"output_format": {
  "type": "exr",
  "tone_mapping": "aces"
}

HDR outputs include linear color space data suitable for compositing pipelines.

Rate Limits

  • Default: 30 requests per minute, 6 images per request.
  • Scale plan: 90 requests per minute, 10 images per request.
  • Enterprise: custom.

Error Codes

CodeReasonResolution
400Invalid size or style tag.Use supported dimensions and style presets.
413Image/mask exceeds upload limit.Compress source assets to <20 MB.
429Exceeded RPM or concurrent call limit.Add retry logic with jitter or request higher quota.

Tips

  • Combine style tags such as cinematic, studio, or macro for specific looks.
  • Store seeds and prompts alongside outputs to reproduce exact renders.
  • Use the image observability pipeline to track success and latency metrics.

Additional Resources