typefile
{
"image": "https://replicate.delivery/pbxt/NYhVBoIOeGMFItamIX2VUE0i03VbKFDTSNksuZ4Se6kd1JXg/0_1.webp"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_BWZ**********************************
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 fofr/why-so-serious using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
image: "https://replicate.delivery/pbxt/NYhVBoIOeGMFItamIX2VUE0i03VbKFDTSNksuZ4Se6kd1JXg/0_1.webp"
};
const output = await replicate.run("fofr/why-so-serious", { 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_BWZ**********************************
This is your API token. Keep it to yourself.
import replicate
Run fofr/why-so-serious using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/why-so-serious",
input={
"image": "https://replicate.delivery/pbxt/NYhVBoIOeGMFItamIX2VUE0i03VbKFDTSNksuZ4Se6kd1JXg/0_1.webp"
}
)
# 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_BWZ**********************************
This is your API token. Keep it to yourself.
Run fofr/why-so-serious 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": {
"image": "https://replicate.delivery/pbxt/NYhVBoIOeGMFItamIX2VUE0i03VbKFDTSNksuZ4Se6kd1JXg/0_1.webp"
}
}' \
https://api.replicate.com/v1/models/fofr/why-so-serious/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "2ew41dfzh1rmc0crqvn96exya4",
"model": "fofr/why-so-serious",
"version": "hidden",
"input": {
"image": "https://replicate.delivery/pbxt/NYhVBoIOeGMFItamIX2VUE0i03VbKFDTSNksuZ4Se6kd1JXg/0_1.webp"
},
"logs": "",
"output": "https://replicate.delivery/xezq/00FIfqTTdGRRO6wpVKZ3ZcxFsjeGTOpMew0uralGHlQMRoYqA/out-0.webp",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-18T20:42:08.648Z",
"started_at": "2025-08-18T20:42:09.131607Z",
"completed_at": "2025-08-18T20:42:14.686351Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/2ew41dfzh1rmc0crqvn96exya4/cancel",
"children": "https://api.replicate.com/v1/predictions/2ew41dfzh1rmc0crqvn96exya4/children",
"get": "https://api.replicate.com/v1/predictions/2ew41dfzh1rmc0crqvn96exya4",
"root": "https://api.replicate.com/v1/predictions/2ew41dfzh1rmc0crqvn96exya4",
"stream": "https://stream.replicate.com/v1/files/bcwr-dpcj6j47amqv6bvvp2f2hekm7iff6p6qlrtuaz7264jhcc34ddtq",
"web": "https://replicate.com/p/2ew41dfzh1rmc0crqvn96exya4"
},
"metrics": {
"predict_time": 5.554744072,
"total_time": 6.038351
}
}
