typetext
{
"prompt": "tiger"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_KgZ**********************************
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 shridharathi/compare-image-models using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
prompt: "tiger"
};
const output = await replicate.run("shridharathi/compare-image-models", { 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_KgZ**********************************
This is your API token. Keep it to yourself.
import replicate
Run shridharathi/compare-image-models using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"shridharathi/compare-image-models",
input={
"prompt": "tiger"
}
)
# 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_KgZ**********************************
This is your API token. Keep it to yourself.
Run shridharathi/compare-image-models 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": {
"prompt": "tiger"
}
}' \
https://api.replicate.com/v1/models/shridharathi/compare-image-models/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "21d11nfkksrma0cqy9csyberf8",
"model": "shridharathi/compare-image-models",
"version": "hidden",
"input": {
"prompt": "tiger"
},
"logs": "Generating images with prompt: 'tiger'\nGrid created successfully with 9 images",
"output": "https://replicate.delivery/xezq/H2x2AMcJhUaACJVKafmbCa1T4Gw2EUhrJgtqcf2ZfsWtdceTB/image_grid.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-07-10T03:21:10.814Z",
"started_at": "2025-07-10T03:21:11.34547Z",
"completed_at": "2025-07-10T03:21:27.040625Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/21d11nfkksrma0cqy9csyberf8/cancel",
"children": "https://api.replicate.com/v1/predictions/21d11nfkksrma0cqy9csyberf8/children",
"get": "https://api.replicate.com/v1/predictions/21d11nfkksrma0cqy9csyberf8",
"root": "https://api.replicate.com/v1/predictions/21d11nfkksrma0cqy9csyberf8",
"stream": "https://stream.replicate.com/v1/files/bcwr-esadxisxizfwlbzpf55csdv3nppn7abbggwxoafnhuey6xvbumjq",
"web": "https://replicate.com/p/21d11nfkksrma0cqy9csyberf8"
},
"metrics": {
"predict_time": 15.695155475,
"total_time": 16.226625
}
}