Skip to main content
POST
/
vendors
/
google
/
v1
/
nano-banana-2
/
edit
Image to Image Edit
curl --request POST \
  --url https://api.mulerun.com/vendors/google/v1/nano-banana-2/edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "prompt": "Add a small knitted wizard hat on the cat's head, make it look natural",
  "images": [
    "https://example.com/cat_photo.png"
  ],
  "aspect_ratio": "1:1",
  "resolution": "2K"
}
EOF
{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "pending",
    "created_at": "2026-02-27T00:00:00.000Z",
    "updated_at": "2026-02-27T00:00:00.000Z"
  }
}

Overview

Nano Banana 2 can restyle or surgically modify a reference image while maintaining global composition. Provide up to 14 reference images (10 object + 4 character) plus a short instructionβ€”Nano Banana 2’s upgraded diffusion backbone keeps lighting, textures, and edge fidelity intact.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Image to image edit request body

prompt
string
required

Text prompt for image editing. Describe the desired change conversationally.

For adding/removing elements: "Add a wizard hat on the cat's head" For inpainting: "Change only the blue sofa to a brown leather chesterfield" For style transfer: "Transform this photo into Van Gogh's Starry Night style"

images
string[]
required

List of reference images for editing. Supports both image URLs and base64-encoded images.

Base64 format: data:image/png;base64,{base64_data}

Supported formats: JPEG, JPG, PNG, BMP, WEBP Max file size per image: 20MB

Nano Banana 2 supports up to 14 reference images:

  • Up to 10 images of objects (high-fidelity preservation)
  • Up to 4 images of characters (character consistency)
Required array length: 1 - 14 elements
aspect_ratio
enum<string>
default:1:1

Aspect ratio of the edited image (width:height).

Available options:
1:1,
1:4,
1:8,
2:3,
3:2,
3:4,
4:1,
4:3,
4:5,
5:4,
8:1,
9:16,
16:9,
21:9
resolution
enum<string>
default:1K

Output resolution preset.

Note: Must use uppercase K (e.g. 1K, 2K, 4K). Lowercase will be rejected.

Available options:
1K,
2K,
4K

Enable Google Search grounding for image editing. When enabled, the model can use Google Search (including Web Search and Image Search) to verify facts and generate imagery based on real-time data such as current weather, stock charts, recent events, or accurate depictions of real-world subjects.

Response

202 - application/json

Accepted - Task created successfully

task_info
object