typetext
{
"aspect_ratio": "21:9",
"output_format": "jpg",
"prompt": "A photograph of an beautiful intricately designed sleek airplane with a shimmering silver body and delicate, translucent wings, parked gracefully on a runway."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RZQ**********************************
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 lucataco/nano-banana-txt2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "21:9",
output_format: "jpg",
prompt: "A photograph of an beautiful intricately designed sleek airplane with a shimmering silver body and delicate, translucent wings, parked gracefully on a runway."
};
const output = await replicate.run("lucataco/nano-banana-txt2img", { 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_RZQ**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/nano-banana-txt2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/nano-banana-txt2img",
input={
"aspect_ratio": "21:9",
"output_format": "jpg",
"prompt": "A photograph of an beautiful intricately designed sleek airplane with a shimmering silver body and delicate, translucent wings, parked gracefully on a runway."
}
)
# 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_RZQ**********************************
This is your API token. Keep it to yourself.
Run lucataco/nano-banana-txt2img 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": "21:9",
"output_format": "jpg",
"prompt": "A photograph of an beautiful intricately designed sleek airplane with a shimmering silver body and delicate, translucent wings, parked gracefully on a runway."
}
}' \
https://api.replicate.com/v1/models/lucataco/nano-banana-txt2img/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "p2rp659mzxrma0cs2zvrsv718w",
"model": "lucataco/nano-banana-txt2img",
"version": "hidden",
"input": {
"aspect_ratio": "21:9",
"output_format": "jpg",
"prompt": "A photograph of an beautiful intricately designed sleek airplane with a shimmering silver body and delicate, translucent wings, parked gracefully on a runway."
},
"logs": "/app/.venv/lib/python3.13/site-packages/coglet/scope.py:36: ExperimentalFeatureWarning: current_scope is an experimental internal function. It may change or be removed without warning.\n warnings.warn(",
"output": "https://replicate.delivery/xezq/eD0te3KaoeFBUp4rdUVfhiS2DpaljIS88obrBBRANnGJgDIVB/tmpr18q5s9a.jpeg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-09-05T03:41:40.991Z",
"started_at": "2025-09-05T03:41:41.393732Z",
"completed_at": "2025-09-05T03:41:54.180273Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/p2rp659mzxrma0cs2zvrsv718w/cancel",
"children": "https://api.replicate.com/v1/predictions/p2rp659mzxrma0cs2zvrsv718w/children",
"get": "https://api.replicate.com/v1/predictions/p2rp659mzxrma0cs2zvrsv718w",
"root": "https://api.replicate.com/v1/predictions/p2rp659mzxrma0cs2zvrsv718w",
"stream": "https://stream.replicate.com/v1/files/bcwr-v7sfyzp6eqx3ilcxih7obzpl4bia5nb6qz35tantiazvvqxahw6q",
"web": "https://replicate.com/p/p2rp659mzxrma0cs2zvrsv718w"
},
"metrics": {
"predict_time": 12.786541106,
"total_time": 13.189273
}
}