typetext
{
"aspect_ratio": "3:2",
"image_input": [],
"output_format": "png",
"prompt": "Draw a world map where the following countries are highligted in orange (rest is white):\nPhilippines\nThailand\nMauritius/Réunion\nMadagascar\nMaldives\nCape Verde\nMallorca\nNew Zealand\nGreece\nPoland\nRoad trip Germany-Switzerland-Italy-France\nScotland\nJapan\nMalaysia\nHawaii\nFiji\nIceland\nCanada\nBahamas\nCuba\nEgypt\nSouth Africa\nMorocco",
"resolution": "2K",
"safety_filter_level": "block_only_high"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7sE**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run google/nano-banana-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "3:2",
image_input: [],
output_format: "png",
prompt: "Draw a world map where the following countries are highligted in orange (rest is white):\nPhilippines\nThailand\nMauritius/Réunion\nMadagascar\nMaldives\nCape Verde\nMallorca\nNew Zealand\nGreece\nPoland\nRoad trip Germany-Switzerland-Italy-France\nScotland\nJapan\nMalaysia\nHawaii\nFiji\nIceland\nCanada\nBahamas\nCuba\nEgypt\nSouth Africa\nMorocco",
resolution: "2K",
safety_filter_level: "block_only_high"
};
const output = await replicate.run("google/nano-banana-pro", { input });
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7sE**********************************
This is your API token. Keep it to yourself.
import replicate
Run google/nano-banana-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"google/nano-banana-pro",
input={
"aspect_ratio": "3:2",
"image_input": [],
"output_format": "png",
"prompt": "Draw a world map where the following countries are highligted in orange (rest is white):\nPhilippines\nThailand\nMauritius/Réunion\nMadagascar\nMaldives\nCape Verde\nMallorca\nNew Zealand\nGreece\nPoland\nRoad trip Germany-Switzerland-Italy-France\nScotland\nJapan\nMalaysia\nHawaii\nFiji\nIceland\nCanada\nBahamas\nCuba\nEgypt\nSouth Africa\nMorocco",
"resolution": "2K",
"safety_filter_level": "block_only_high"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7sE**********************************
This is your API token. Keep it to yourself.
Run google/nano-banana-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"input": {
"aspect_ratio": "3:2",
"image_input": [],
"output_format": "png",
"prompt": "Draw a world map where the following countries are highligted in orange (rest is white):\\nPhilippines\\nThailand\\nMauritius/Réunion\\nMadagascar\\nMaldives\\nCape Verde\\nMallorca\\nNew Zealand\\nGreece\\nPoland\\nRoad trip Germany-Switzerland-Italy-France\\nScotland\\nJapan\\nMalaysia\\nHawaii\\nFiji\\nIceland\\nCanada\\nBahamas\\nCuba\\nEgypt\\nSouth Africa\\nMorocco",
"resolution": "2K",
"safety_filter_level": "block_only_high"
}
}' \
https://api.replicate.com/v1/models/google/nano-banana-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "atk5ntc1bsrmw0cvh009gw0e4c",
"model": "google/nano-banana-pro",
"version": "hidden",
"input": {
"aspect_ratio": "3:2",
"image_input": [],
"output_format": "png",
"prompt": "Draw a world map where the following countries are highligted in orange (rest is white):\nPhilippines\nThailand\nMauritius/Réunion\nMadagascar\nMaldives\nCape Verde\nMallorca\nNew Zealand\nGreece\nPoland\nRoad trip Germany-Switzerland-Italy-France\nScotland\nJapan\nMalaysia\nHawaii\nFiji\nIceland\nCanada\nBahamas\nCuba\nEgypt\nSouth Africa\nMorocco",
"resolution": "2K",
"safety_filter_level": "block_only_high"
},
"logs": "Generating image...\nGenerated image in 26.48 seconds",
"output": "https://replicate.delivery/xezq/Dyf0qzYdQzRvT6fjjhifIJZvO4Q2gb61uBoawDhXhvUP35zrA/tmpn1a4dwo4.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2026-01-04T07:54:53.15Z",
"started_at": "2026-01-04T07:54:53.182956Z",
"completed_at": "2026-01-04T07:55:20.294596Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/atk5ntc1bsrmw0cvh009gw0e4c/cancel",
"get": "https://api.replicate.com/v1/predictions/atk5ntc1bsrmw0cvh009gw0e4c",
"stream": "https://stream.replicate.com/v1/files/jbxs-l7xv7mefejg5qwbq52necu6jtuldjhe6azsyms7euhnnllxdowsa",
"web": "https://replicate.com/p/atk5ntc1bsrmw0cvh009gw0e4c"
},
"metrics": {
"predict_time": 27.111639961,
"total_time": 27.144596207
}
}