typetext
{
"aspect_ratio": "match_input_image",
"image_input": [
"https://replicate.delivery/pbxt/NtYoUZb7EsMF39XUsnvWf1jDe9nmv5RaOuzDbXSaNs34k3TX/replicate-prediction-7asfcbke4srme0csxndanxmt40%20%281%29.webp",
"https://replicate.delivery/pbxt/NtYoVAn0eXVbhfIW2HqH4feMj9RCJwVVK4shp1g8IDP0j1lL/replicate-prediction-rcmejsat2xrme0csxnys1h1ay4.jpg"
],
"output_format": "jpg",
"prompt": "Add the five characters onto the deck of the boat, conducting various duties aboard the ship. one person is standing on the bench. One person is leaning on the mast. One person is sitting on the deck. Two people stand near the back looking out over the ocean Make them 1/2 size. The all look away from the camera out over the ocean, absorbed in their duties."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_3h5**********************************
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 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "match_input_image",
image_input: ["https://replicate.delivery/pbxt/NtYoUZb7EsMF39XUsnvWf1jDe9nmv5RaOuzDbXSaNs34k3TX/replicate-prediction-7asfcbke4srme0csxndanxmt40%20%281%29.webp","https://replicate.delivery/pbxt/NtYoVAn0eXVbhfIW2HqH4feMj9RCJwVVK4shp1g8IDP0j1lL/replicate-prediction-rcmejsat2xrme0csxnys1h1ay4.jpg"],
output_format: "jpg",
prompt: "Add the five characters onto the deck of the boat, conducting various duties aboard the ship. one person is standing on the bench. One person is leaning on the mast. One person is sitting on the deck. Two people stand near the back looking out over the ocean Make them 1/2 size. The all look away from the camera out over the ocean, absorbed in their duties."
};
const output = await replicate.run("google/nano-banana", { 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_3h5**********************************
This is your API token. Keep it to yourself.
import replicate
Run google/nano-banana using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"google/nano-banana",
input={
"aspect_ratio": "match_input_image",
"image_input": ["https://replicate.delivery/pbxt/NtYoUZb7EsMF39XUsnvWf1jDe9nmv5RaOuzDbXSaNs34k3TX/replicate-prediction-7asfcbke4srme0csxndanxmt40%20%281%29.webp","https://replicate.delivery/pbxt/NtYoVAn0eXVbhfIW2HqH4feMj9RCJwVVK4shp1g8IDP0j1lL/replicate-prediction-rcmejsat2xrme0csxnys1h1ay4.jpg"],
"output_format": "jpg",
"prompt": "Add the five characters onto the deck of the boat, conducting various duties aboard the ship. one person is standing on the bench. One person is leaning on the mast. One person is sitting on the deck. Two people stand near the back looking out over the ocean Make them 1/2 size. The all look away from the camera out over the ocean, absorbed in their duties."
}
)
# 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_3h5**********************************
This is your API token. Keep it to yourself.
Run google/nano-banana 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": "match_input_image",
"image_input": ["https://replicate.delivery/pbxt/NtYoUZb7EsMF39XUsnvWf1jDe9nmv5RaOuzDbXSaNs34k3TX/replicate-prediction-7asfcbke4srme0csxndanxmt40%20%281%29.webp","https://replicate.delivery/pbxt/NtYoVAn0eXVbhfIW2HqH4feMj9RCJwVVK4shp1g8IDP0j1lL/replicate-prediction-rcmejsat2xrme0csxnys1h1ay4.jpg"],
"output_format": "jpg",
"prompt": "Add the five characters onto the deck of the boat, conducting various duties aboard the ship. one person is standing on the bench. One person is leaning on the mast. One person is sitting on the deck. Two people stand near the back looking out over the ocean Make them 1/2 size. The all look away from the camera out over the ocean, absorbed in their duties."
}
}' \
https://api.replicate.com/v1/models/google/nano-banana/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "8hah38wndsrmc0csxp7t5eszx8",
"model": "google/nano-banana",
"version": "hidden",
"input": {
"aspect_ratio": "match_input_image",
"image_input": [
"https://replicate.delivery/pbxt/NtYoUZb7EsMF39XUsnvWf1jDe9nmv5RaOuzDbXSaNs34k3TX/replicate-prediction-7asfcbke4srme0csxndanxmt40%20%281%29.webp",
"https://replicate.delivery/pbxt/NtYoVAn0eXVbhfIW2HqH4feMj9RCJwVVK4shp1g8IDP0j1lL/replicate-prediction-rcmejsat2xrme0csxnys1h1ay4.jpg"
],
"output_format": "jpg",
"prompt": "Add the five characters onto the deck of the boat, conducting various duties aboard the ship. one person is standing on the bench. One person is leaning on the mast. One person is sitting on the deck. Two people stand near the back looking out over the ocean Make them 1/2 size. The all look away from the camera out over the ocean, absorbed in their duties."
},
"logs": "Generating image with Gemini Flash...\nGenerated image in 10.10 seconds",
"output": "https://replicate.delivery/xezq/3gjzHRxGZdaIDBEe8udsucta85exSjYnwv7vf0lfKs1zCverC/tmp3cz30ptx.jpeg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-10-16T15:07:14.158Z",
"started_at": "2025-10-16T15:07:14.305013Z",
"completed_at": "2025-10-16T15:07:24.588437Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/8hah38wndsrmc0csxp7t5eszx8/cancel",
"get": "https://api.replicate.com/v1/predictions/8hah38wndsrmc0csxp7t5eszx8",
"stream": "https://stream.replicate.com/v1/files/bcwr-a5abkzsewsu66snycdctcm62mg3t4zzuh5lz6gfd7dsadk4d7bpq",
"web": "https://replicate.com/p/8hah38wndsrmc0csxp7t5eszx8"
},
"metrics": {
"predict_time": 10.28342455,
"total_time": 10.430437
}
}

