typefile
{
"input_gif": "https://replicate.delivery/pbxt/MpG2oO0L90Y3SgJtJ3c5JuDrGFBQzXWk4NyZw9atQJf04Aaz/input_terminator.gif"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7OE**********************************
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 ghostface-ai/gif-upscaler using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"ghostface-ai/gif-upscaler:460be71a966c1546473a73d20e91b46a540c1251232ef4ac984417c20763feaa",
{
input: {
input_gif: "https://replicate.delivery/pbxt/MpG2oO0L90Y3SgJtJ3c5JuDrGFBQzXWk4NyZw9atQJf04Aaz/input_terminator.gif"
}
}
);
// 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_7OE**********************************
This is your API token. Keep it to yourself.
import replicate
Run ghostface-ai/gif-upscaler using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ghostface-ai/gif-upscaler:460be71a966c1546473a73d20e91b46a540c1251232ef4ac984417c20763feaa",
input={
"input_gif": "https://replicate.delivery/pbxt/MpG2oO0L90Y3SgJtJ3c5JuDrGFBQzXWk4NyZw9atQJf04Aaz/input_terminator.gif"
}
)
# 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_7OE**********************************
This is your API token. Keep it to yourself.
Run ghostface-ai/gif-upscaler 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 $'{
"version": "ghostface-ai/gif-upscaler:460be71a966c1546473a73d20e91b46a540c1251232ef4ac984417c20763feaa",
"input": {
"input_gif": "https://replicate.delivery/pbxt/MpG2oO0L90Y3SgJtJ3c5JuDrGFBQzXWk4NyZw9atQJf04Aaz/input_terminator.gif"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "1bvjkvqhxhrg80cpb2csgt6fkr",
"model": "ghostface-ai/gif-upscaler",
"version": "460be71a966c1546473a73d20e91b46a540c1251232ef4ac984417c20763feaa",
"input": {
"input_gif": "https://replicate.delivery/pbxt/MpG2oO0L90Y3SgJtJ3c5JuDrGFBQzXWk4NyZw9atQJf04Aaz/input_terminator.gif"
},
"logs": "👻\nStarting...\nProcessed frame: 1/9\nProcessed frame: 2/9\nProcessed frame: 3/9\nProcessed frame: 4/9\nProcessed frame: 5/9\nProcessed frame: 6/9\nProcessed frame: 7/9\nProcessed frame: 8/9\nProcessed frame: 9/9\nOriginal GIF frame duration: 50ms -> Calculated FPS: 20.00\nIMAGEIO FFMPEG_WRITER WARNING: input image is not divisible by macro_block_size=16, resizing from (2000, 908) to (2000, 912) to ensure video compatibility with most codecs and players. To prevent resizing, make your input image divisible by the macro_block_size or set the macro_block_size to 1 (risking incompatibility).\nMultiple -pix_fmt options specified for stream 0, only the last option '-pix_fmt yuv420p' will be used.\nMP4 video saved as /tmp/result.mp4 with 20.00 FPS (matching original GIF)\nProcessing complete!\n👻",
"output": "https://replicate.delivery/czjl/uE4Q8ooop9oQBxjQwTWwKYu9dQ3fl4KrlZG8KeCwgBdw5fJpA/result.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-04-21T13:46:46.124Z",
"started_at": "2025-04-21T13:46:46.139704Z",
"completed_at": "2025-04-21T13:47:28.89438Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/1bvjkvqhxhrg80cpb2csgt6fkr/cancel",
"get": "https://api.replicate.com/v1/predictions/1bvjkvqhxhrg80cpb2csgt6fkr",
"stream": "https://stream.replicate.com/v1/files/fddq-ozobqfbr3bgu4cc5tnq7zvv4nb2imlnbefwi2vrtv3jvxbnzy2ca",
"web": "https://replicate.com/p/1bvjkvqhxhrg80cpb2csgt6fkr"
},
"metrics": {
"predict_time": 42.754676031,
"total_time": 42.77038
}
}