images-reframe

Reframe an image with Nano Banana Pro

Changed on

Recompose one image for a new aspect ratio with Nano Banana Pro, at a 1K, 2K, or 4K output tier. Supply either an existing Ideogram image asset or raw image bytes, but not both. The requested aspect ratio is resolved to the closest dimensions the model supports at that tier.

This operation is asynchronous. It returns as soon as the request is accepted; poll GET /v2/generations/{generation_id} for completion and results.

post/v2/image/reframe/nano-banana-pro

Request

  • Base URL: (relative, and it does not resolve against the document’s source URL)
  • URL: /v2/image/reframe/nano-banana-pro
  • Auth: one of:
    • API key in header Api-Key
    • HTTP bearer

Query parameters

dry_runboolean

When true, the request is validated and priced but not run: nothing is generated, stored, or billed, and no safety review is performed. The response is a PriceQuote object instead of the usual response for this endpoint. Send exactly the request you would send to generate, so the quote reflects the same options.

Request body

imagestring binary

The JPEG, PNG, or WEBP image to reframe (max 50MB).

aspect_ratio'1:1' | '3:2' | '2:3' | '4:3' | '3:4' | '5:4' | '4:5' | '16:9' | '9:16' | '21:9' required

Aspect ratios Nano Banana Pro can reframe an image to.

resolution_tier'1K' | '2K' | '4K'

The output resolution tier. The model sizes its output by tier at the requested aspect ratio; exact pixel dimensions cannot be requested.

privateboolean

API-key requests are always private. For bearer-authenticated requests, this controls whether the result is private; when omitted, it follows the caller's plan entitlement. Enterprise generations are always private.

num_imagesinteger

The number of output images to generate.

seedinteger

Random seed. Set for reproducible generation.

Example request

{
  "image_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  },
  "seed": 12345
}

Response

An acknowledgement to poll with GET /v2/generations/{generation_id}.

generation_idstring required

URL-safe base64 ID of the accepted generation. Accepted by the GET /v2/generations/{generation_id} polling endpoint.

seedinteger required

Random seed. Set for reproducible generation.

widthinteger required

The resolved output width in pixels.

heightinteger required

The resolved output height in pixels.

Example response

{
  "seed": 12345,
  "generation_id": "generation_id",
  "width": 0,
  "height": 6
}

Changes

    • ○

      added the new optional request property / (media type: multipart/form-data)

    • ○

      added the new optional request property / (media type: application/json)

    • ▲

      request property was restricted to a list of enum values (media type: multipart/form-data)

    • ▲

      request property was restricted to a list of enum values (media type: application/json)

    • ○

      added the new 16:9 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 16:9 enum value to the request property (media type: application/json)

    • ○

      added the new 1:1 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 1:1 enum value to the request property (media type: application/json)

    • ○

      added the new 21:9 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 21:9 enum value to the request property (media type: application/json)

    • ○

      added the new 2:3 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 2:3 enum value to the request property (media type: application/json)

    • ○

      added the new 3:2 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 3:2 enum value to the request property (media type: application/json)

    • ○

      added the new 3:4 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 3:4 enum value to the request property (media type: application/json)

    • ○

      added the new 4:3 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 4:3 enum value to the request property (media type: application/json)

    • ○

      added the new 4:5 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 4:5 enum value to the request property (media type: application/json)

    • ○

      added the new 5:4 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 5:4 enum value to the request property (media type: application/json)

    • ○

      added the new 9:16 enum value to the request property (media type: multipart/form-data)

    • ○

      added the new 9:16 enum value to the request property (media type: application/json)

    • ○

      the request property's minLength was decreased from 3 to 0 (media type: multipart/form-data)

    • ○

      the request property's minLength was decreased from 3 to 0 (media type: application/json)

    • ○

      removed the pattern ^[1-9][0-9]*:[1-9][0-9]*$ from the request property (media type: multipart/form-data)

    • ○

      removed the pattern ^[1-9][0-9]*:[1-9][0-9]*$ from the request property (media type: application/json)