typetext
{
"aspect_ratio": "3:2",
"output_format": "png",
"prompt": "A 19th-century hospital watercolor medical illustration on aged paper of a woman's right hand with chronic tophaceous gout: large lobulated pale-pink tophaceous swellings over the knuckles and a big tophus at the side of the hand, delicate pencil outline, soft wash shading, case number written in the top-right corner, artist's signature and date in faded pencil at lower left.",
"resolution": "2K"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_FIs**********************************
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-2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "3:2",
output_format: "png",
prompt: "A 19th-century hospital watercolor medical illustration on aged paper of a woman's right hand with chronic tophaceous gout: large lobulated pale-pink tophaceous swellings over the knuckles and a big tophus at the side of the hand, delicate pencil outline, soft wash shading, case number written in the top-right corner, artist's signature and date in faded pencil at lower left.",
resolution: "2K"
};
const output = await replicate.run("google/nano-banana-2.1", { 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_FIs**********************************
This is your API token. Keep it to yourself.
import replicate
Run google/nano-banana-2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"google/nano-banana-2.1",
input={
"aspect_ratio": "3:2",
"output_format": "png",
"prompt": "A 19th-century hospital watercolor medical illustration on aged paper of a woman's right hand with chronic tophaceous gout: large lobulated pale-pink tophaceous swellings over the knuckles and a big tophus at the side of the hand, delicate pencil outline, soft wash shading, case number written in the top-right corner, artist's signature and date in faded pencil at lower left.",
"resolution": "2K"
}
)
# 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_FIs**********************************
This is your API token. Keep it to yourself.
Run google/nano-banana-2.1 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",
"output_format": "png",
"prompt": "A 19th-century hospital watercolor medical illustration on aged paper of a woman\'s right hand with chronic tophaceous gout: large lobulated pale-pink tophaceous swellings over the knuckles and a big tophus at the side of the hand, delicate pencil outline, soft wash shading, case number written in the top-right corner, artist\'s signature and date in faded pencil at lower left.",
"resolution": "2K"
}
}' \
https://api.replicate.com/v1/models/google/nano-banana-2.1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "p6vkngx269rmt0d1ne49bevd34",
"model": "google/nano-banana-2.1",
"version": "hidden",
"input": {
"aspect_ratio": "3:2",
"output_format": "png",
"prompt": "A 19th-century hospital watercolor medical illustration on aged paper of a woman's right hand with chronic tophaceous gout: large lobulated pale-pink tophaceous swellings over the knuckles and a big tophus at the side of the hand, delicate pencil outline, soft wash shading, case number written in the top-right corner, artist's signature and date in faded pencil at lower left.",
"resolution": "2K"
},
"logs": "No sid\nGenerating image with Gemini Flash...\nTokens: 3402\nGenerated image in 23.80 seconds",
"output": "https://replicate.delivery/xezq/87eZ4bvQkRTBAy8eeEGmpL1eaDx3UjKi7BuCvUhHMLBwsH6dB/tmpflasz2jr.png",
"data_removed": false,
"error": null,
"source": "api",
"status": "succeeded",
"created_at": "2026-11-05T11:47:00.786Z",
"started_at": "2026-11-05T11:47:00.801601Z",
"completed_at": "2026-11-05T11:47:26.152193Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/p6vkngx269rmt0d1ne49bevd34/cancel",
"get": "https://api.replicate.com/v1/predictions/p6vkngx269rmt0d1ne49bevd34",
"stream": "https://stream.replicate.com/v1/files/jbxs-3fu5elv76w63vqqn3c2mjuqjnfml5727ynbn2vjdrmnjiwsy7npq",
"web": "https://replicate.com/p/p6vkngx269rmt0d1ne49bevd34"
},
"metrics": {
"image_output_count": 1,
"predict_time": 25.350592354,
"resolution_target": "2K",
"total_time": 25.366193491
}
}