Powerful inpainting model run by Nano Banana Pro. Uses image, mask and optional reference image.
One POST request. Get the result back directly — as an image, video, or JSON depending on the tool.
curl -X POST https://apiai.me/api/workflow/nano-banana-pro-inpainting \
-H "X-API-Key: YOUR_API_KEY" \
-F "image=@input.jpg" \
-F "aspect_ratio=1:1" \
-F "blend_strength=1.0" \
-F "image_mask=@image.jpg" \
-F "image_reference=@image.jpg" \
-F "image_size=1K" \
-F "max_output_tokens=VALUE" \
-F "negative_prompt=VALUE" \
-F "prompt=Add prompt here" \
-F "safety_filter_level=BLOCK_ONLY_HIGH" \
-F "temperature=0.3" \
-F "top_k=64" \
-F "top_p=0.95"
--output result.png
Test this tool visually before writing any code. Upload an image, set parameters, and see the result live. When it looks right, copy the auto-generated curl command and paste it into your app.
Process hundreds of images at once without writing a loop. Upload a CSV with one row per item, set your parameters, and download the results as a ZIP when they're done.
| Name | Required | Description | Default / Options |
|---|---|---|---|
aspect_ratio |
optional | Output aspect ratio. Options: 1:1, 3:4, 4:3, 9:16, 16:9. The mask is padded (no crop) to this aspect before the Gemini call, so the final image has exactly this shape. | 1:13:44:39:1616:9
|
blend_strength |
optional | How strongly the AI output replaces the subject inside the mask. 1.0 = full AI; <1.0 mixes in some subject. | 1.0
|
image_mask |
required | Grayscale mask. White = where AI output should appear. Black = ignored area. | — |
image_reference |
optional | Optional reference image (color sample, material to apply etc.). If provided, Gemini receives it as a second image alongside the main image. If skipped, the prompt alone drives the inpainting. | — |
image_size |
optional | Output resolution. Options: 1K, 2K, 4K. | 1K
|
max_output_tokens |
optional | Max output tokens (up to 32768). Leave empty to use the model default. | — |
negative_prompt |
optional | Things to exclude. If set, appended to the prompt as a 'Avoid: ... | — |
prompt |
required | Instruction for Gemini. Describes how to apply the reference to the subject. | Add prompt here
|
safety_filter_level |
optional | BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH, BLOCK_NONE. Applied to all safety categories. | BLOCK_ONLY_HIGH
|
temperature |
optional | 0 = deterministic, 1 = creative . Default 0.3 keeps the AI close to the subject. | 0.3
|
top_k |
optional | Max 64. Lower values prioritize structural coherence; higher values allow for more intricate and varied details. | 64
|
top_p |
optional | Max 1. Lower values keep the output focused and consistent; higher values allow for more variety and creative nuance. | 0.95
|
Get an API key, test Nano Banana Pro Inpainting in the dashboard, and copy the curl command.