typefile
{
"format": "JPEG",
"image": "https://replicate.delivery/pbxt/NspfldJcshfV8JbFIwQTuj31LoC9GuCrVKTpfQLjF75NrPqQ/replicate-prediction-ttc6bk90fxrmc0cswbz8rtkb78.jpg",
"progressive": true,
"quality": 85
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_KqE**********************************
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/featured-img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
format: "JPEG",
image: "https://replicate.delivery/pbxt/NspfldJcshfV8JbFIwQTuj31LoC9GuCrVKTpfQLjF75NrPqQ/replicate-prediction-ttc6bk90fxrmc0cswbz8rtkb78.jpg",
progressive: true,
quality: 85
};
const output = await replicate.run("lucataco/featured-img", { 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_KqE**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/featured-img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/featured-img",
input={
"format": "JPEG",
"image": "https://replicate.delivery/pbxt/NspfldJcshfV8JbFIwQTuj31LoC9GuCrVKTpfQLjF75NrPqQ/replicate-prediction-ttc6bk90fxrmc0cswbz8rtkb78.jpg",
"progressive": True,
"quality": 85
}
)
# 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_KqE**********************************
This is your API token. Keep it to yourself.
Run lucataco/featured-img 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": {
"format": "JPEG",
"image": "https://replicate.delivery/pbxt/NspfldJcshfV8JbFIwQTuj31LoC9GuCrVKTpfQLjF75NrPqQ/replicate-prediction-ttc6bk90fxrmc0cswbz8rtkb78.jpg",
"progressive": true,
"quality": 85
}
}' \
https://api.replicate.com/v1/models/lucataco/featured-img/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "qbzmr0aswxrme0cswbzrvnzazg",
"model": "lucataco/featured-img",
"version": "hidden",
"input": {
"format": "JPEG",
"image": "https://replicate.delivery/pbxt/NspfldJcshfV8JbFIwQTuj31LoC9GuCrVKTpfQLjF75NrPqQ/replicate-prediction-ttc6bk90fxrmc0cswbz8rtkb78.jpg",
"progressive": true,
"quality": 85
},
"logs": "Original size: 2594.1 KB\nCompressed size: 537.4 KB\nCompression: 79.3% reduction\nFinal dimensions: (4096, 3072)",
"output": "https://replicate.delivery/xezq/WkmwtJj91wJOBpKAlitPvy8YXGJRwcYKQfe2ab2tkZjafAeVB/compressed_image.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-10-14T13:53:29.575Z",
"started_at": "2025-10-14T13:53:29.886896Z",
"completed_at": "2025-10-14T13:53:30.500271Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/qbzmr0aswxrme0cswbzrvnzazg/cancel",
"children": "https://api.replicate.com/v1/predictions/qbzmr0aswxrme0cswbzrvnzazg/children",
"get": "https://api.replicate.com/v1/predictions/qbzmr0aswxrme0cswbzrvnzazg",
"root": "https://api.replicate.com/v1/predictions/qbzmr0aswxrme0cswbzrvnzazg",
"stream": "https://stream.replicate.com/v1/files/bcwr-ywckxveqqpa27xrghgnl5l4mqtoawbg6ztk2rvgeutcdjc6dlouq",
"web": "https://replicate.com/p/qbzmr0aswxrme0cswbzrvnzazg"
},
"metrics": {
"predict_time": 0.613375945,
"total_time": 0.925271
}
}
