imagesarrayobligatoire
The URLs of the images to use for image-to-image generation or image editing.
google/nano-banana-pro/editNano Banana Pro is Google's new state-of-the-art image generation and editing model
Essayer le modèle
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Sélectionnez un exemple pour charger ses entrées et son résultat dans le playground.
{
"aspect_ratio": "2:3",
"images": [
"https://static.sandbase.ai/examples/a24d699f-ac6b-4c57-b162-f6073c15d031/input/80b3b8e7-87db-4487-ab30-a844b4f22b96.png",
"https://static.sandbase.ai/examples/a24d699f-ac6b-4c57-b162-f6073c15d031/input/7c80d815-ad38-457a-9664-bf7371a876b5.png"
],
"prompt": "Create a professional e-commerce fashion photo. Take the blue floral dress from the first image and let the woman from the second image wear it. Generate a realistic, full-body shot of the woman wearing the dress, with the lighting and shadows adjusted to match the outdoor environment."
}Préférence humaine
Scores Elo issus de votes comparatifs anonymes côte à côte, comparés à d’autres modèles d’image et de vidéo.
Classements provenant de Artificial Analysis Arena
Arena d’édition d’image : les personnes choisissent la meilleure de deux modifications de la même image et de la même instruction, sans voir les noms des modèles.
Edit or combine images with Nano Banana Pro. Send one or more images with an instruction; the model keeps identity and layout where you do not ask for changes, and can render new text accurately.
| Field | Type | Default | Notes |
|---|---|---|---|
images | image URL[], required | — | Images to edit or combine, Image 1, Image 2, … |
prompt | string, required | — | Up to 50,000 characters. |
aspect_ratio | 21:9 / 16:9 / 3:2 / 4:3 / 5:4 / 1:1 / 4:5 / 3:4 / 2:3 / 9:16 | — | Omit to follow the first input image. |
output_format | jpeg / png | png | Output file format. |
resolution | 1K / 2K / 4K | 1K | Sets the per-image rate. |
$0.134 per output image at 1K or 2K and $0.24 at 4K, plus $0.0011 per input image, Google's list price.
| Inputs | 1K | 2K | 4K |
|---|---|---|---|
| 1 input image | $0.1351 | $0.1351 | $0.2411 |
| 3 input images | $0.1373 | $0.1373 | $0.2433 |
| 6 input images | $0.1406 | $0.1406 | $0.2466 |
Failed runs are not charged.
Other Nano Banana endpoints: google/nano-banana-pro, google/nano-banana-2, google/nano-banana-2/edit, google/nano-banana-2-lite, google/nano-banana-2-lite/edit.
Commencer à construire
Soumettez ce modèle via l'API Unified Run de SandBase.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "google/nano-banana-pro/edit",
"images": [
"https://ai.google.dev/static/gemini-api/docs/images/dress.png",
"https://ai.google.dev/static/gemini-api/docs/images/model.png"
],
"prompt": "Create a professional e-commerce fashion photo. Take the blue floral dress from the first image and let the woman from the second image wear it. Generate a realistic, full-body shot of the woman wearing the dress, with the lighting and shadows adjusted to match the outdoor environment.",
"resolution": "1K",
"output_format": "png"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Créez une clé API SandBase et définissez-la dans l'environnement de votre serveur. Toutes les requêtes utilisent l'authentification Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conservez la clé sur votre serveur. Ne l'exposez pas dans le code du navigateur et ne la committez pas dans un dépôt.
Faites un POST sur /v1/run avec cet ID de modèle et ses entrées. L'exemple de requête ci-dessus inclut la soumission et le polling.
Utilisez l'ID d'exécution renvoyé pour interroger jusqu'à ce que le statut soit completed, failed ou timeout. Ne lisez la sortie qu'une fois completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Passez une URL de fichier accessible publiquement dans le champ image, video ou audio du modèle. Les formats pris en charge et les limites sont indiqués à côté de chaque entrée du Playground.
Utilisez le contrôle upload ou replace sur les champs image pris en charge dans le Playground. Les champs URL vidéo acceptent une vidéo de conduite hébergée ; cela n'implique pas la prise en charge de l'importation vidéo.
imagesarrayobligatoireThe URLs of the images to use for image-to-image generation or image editing.
promptstringobligatoireThe text prompt to generate an image from.
Par défaut : "Create a professional e-commerce fashion photo. Take the blue floral dress from the first image and let the woman from the second image wear it. Generate a realistic, full-body shot of the woman wearing the dress, with the lighting and shadows adjusted to match the outdoor environment."
resolutionstringThe resolution of the image to generate.
Par défaut : "1K"
Valeurs possibles : "1K", "2K", "4K"
aspect_ratiostringThe aspect ratio of the generated image. Leave empty to keep the aspect ratio of the input image.
Valeurs possibles : "21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", "9:16"
output_formatstringThe format of the generated image.
Par défaut : "png"
Valeurs possibles : "jpeg", "png"
{
"model": "google/nano-banana-pro/edit",
"images": [
"https://ai.google.dev/static/gemini-api/docs/images/dress.png",
"https://ai.google.dev/static/gemini-api/docs/images/model.png"
],
"prompt": "Create a professional e-commerce fashion photo. Take the blue floral dress from the first image and let the woman from the second image wear it. Generate a realistic, full-body shot of the woman wearing the dress, with the lighting and shadows adjusted to match the outdoor environment.",
"resolution": "1K",
"output_format": "png"
}Une exécution terminée expose son résultat dans output. Ce qui suit est l'exemple enregistré du modèle, et non une nouvelle génération.
[
{
"source": "Google AI for Developers",
"source_url": "https://ai.google.dev/gemini-api/docs/image-generation",
"url": "https://static.sandbase.ai/examples/a24d699f-ac6b-4c57-b162-f6073c15d031/output/e849b750-a076-4693-8f0f-011973b72837.png"
}
]