typetext
{
"aspect_ratio": "1:1",
"image_input": [
"https://api.replicate.com/v1/files/MjE2MWNmNzctZmJlNC00ZDFjLWIzNWItNGNmZGY1NDBkYzgz"
],
"output_format": "jpg",
"prompt": "A black and white pixel art portrait of the uploaded image, inspired by classic 8-bit and 16-bit video game character design. The face should be stylized and symmetrical, with clean pixel clusters, a simple color palette of blak and white, and clear outlines. The expression is neutral but friendly, with exaggerated eyebrows and glasses rendered in blocky pixel form. The person wears a baseball cap. The background is a flat white. Preserve likeness and facial structure from the reference photo, but simplify and stylize to match classic pixel art aesthetics — crisp edges, limited shading, and no dithering."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_SVT**********************************
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: "1:1",
image_input: ["https://api.replicate.com/v1/files/MjE2MWNmNzctZmJlNC00ZDFjLWIzNWItNGNmZGY1NDBkYzgz"],
output_format: "jpg",
prompt: "A black and white pixel art portrait of the uploaded image, inspired by classic 8-bit and 16-bit video game character design. The face should be stylized and symmetrical, with clean pixel clusters, a simple color palette of blak and white, and clear outlines. The expression is neutral but friendly, with exaggerated eyebrows and glasses rendered in blocky pixel form. The person wears a baseball cap. The background is a flat white. Preserve likeness and facial structure from the reference photo, but simplify and stylize to match classic pixel art aesthetics — crisp edges, limited shading, and no dithering."
};
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_SVT**********************************
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": "1:1",
"image_input": ["https://api.replicate.com/v1/files/MjE2MWNmNzctZmJlNC00ZDFjLWIzNWItNGNmZGY1NDBkYzgz"],
"output_format": "jpg",
"prompt": "A black and white pixel art portrait of the uploaded image, inspired by classic 8-bit and 16-bit video game character design. The face should be stylized and symmetrical, with clean pixel clusters, a simple color palette of blak and white, and clear outlines. The expression is neutral but friendly, with exaggerated eyebrows and glasses rendered in blocky pixel form. The person wears a baseball cap. The background is a flat white. Preserve likeness and facial structure from the reference photo, but simplify and stylize to match classic pixel art aesthetics — crisp edges, limited shading, and no dithering."
}
)
# 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_SVT**********************************
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": "1:1",
"image_input": ["https://api.replicate.com/v1/files/MjE2MWNmNzctZmJlNC00ZDFjLWIzNWItNGNmZGY1NDBkYzgz"],
"output_format": "jpg",
"prompt": "A black and white pixel art portrait of the uploaded image, inspired by classic 8-bit and 16-bit video game character design. The face should be stylized and symmetrical, with clean pixel clusters, a simple color palette of blak and white, and clear outlines. The expression is neutral but friendly, with exaggerated eyebrows and glasses rendered in blocky pixel form. The person wears a baseball cap. The background is a flat white. Preserve likeness and facial structure from the reference photo, but simplify and stylize to match classic pixel art aesthetics — crisp edges, limited shading, and no dithering."
}
}' \
https://api.replicate.com/v1/models/google/nano-banana/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "7spqhpbpgsrm80ctejev10624r",
"model": "google/nano-banana",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"image_input": [
"https://api.replicate.com/v1/files/MjE2MWNmNzctZmJlNC00ZDFjLWIzNWItNGNmZGY1NDBkYzgz"
],
"output_format": "jpg",
"prompt": "A black and white pixel art portrait of the uploaded image, inspired by classic 8-bit and 16-bit video game character design. The face should be stylized and symmetrical, with clean pixel clusters, a simple color palette of blak and white, and clear outlines. The expression is neutral but friendly, with exaggerated eyebrows and glasses rendered in blocky pixel form. The person wears a baseball cap. The background is a flat white. Preserve likeness and facial structure from the reference photo, but simplify and stylize to match classic pixel art aesthetics — crisp edges, limited shading, and no dithering."
},
"logs": "Generating image with Gemini Flash...\nGenerated image in 10.76 seconds",
"output": "https://replicate.delivery/xezq/N4bBqCVbTD6IPB59n4Qk0Htt2ffZ0XVJfpQwvzr42vmv4pQrA/tmp_b854le4.jpeg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-11-11T20:31:07.91Z",
"started_at": "2025-11-11T20:31:08.443449Z",
"completed_at": "2025-11-11T20:31:19.434093Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/7spqhpbpgsrm80ctejev10624r/cancel",
"get": "https://api.replicate.com/v1/predictions/7spqhpbpgsrm80ctejev10624r",
"stream": "https://stream.replicate.com/v1/files/bcwr-5xajvj35jqnnsdxrrhafv5534o4gqcoyue5mx4viaovwirabuy6a",
"web": "https://replicate.com/p/7spqhpbpgsrm80ctejev10624r"
},
"metrics": {
"predict_time": 10.990644585,
"total_time": 11.524093771
}
}