typefile
{
"enhance_model": "Low Resolution V2",
"face_enhancement": true,
"face_enhancement_creativity": 0.5,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/MtnpGxNIVJlHAMZmQNl5bLARbYpiLahniAYis3RsRN2KwhfJ/out-1.webp",
"output_format": "jpg",
"subject_detection": "Foreground",
"upscale_factor": "4x"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_FOw**********************************
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 topazlabs/image-upscale using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
enhance_model: "Low Resolution V2",
face_enhancement: true,
face_enhancement_creativity: 0.5,
face_enhancement_strength: 0.8,
image: "https://replicate.delivery/pbxt/MtnpGxNIVJlHAMZmQNl5bLARbYpiLahniAYis3RsRN2KwhfJ/out-1.webp",
output_format: "jpg",
subject_detection: "Foreground",
upscale_factor: "4x"
};
const output = await replicate.run("topazlabs/image-upscale", { 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_FOw**********************************
This is your API token. Keep it to yourself.
import replicate
Run topazlabs/image-upscale using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"topazlabs/image-upscale",
input={
"enhance_model": "Low Resolution V2",
"face_enhancement": True,
"face_enhancement_creativity": 0.5,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/MtnpGxNIVJlHAMZmQNl5bLARbYpiLahniAYis3RsRN2KwhfJ/out-1.webp",
"output_format": "jpg",
"subject_detection": "Foreground",
"upscale_factor": "4x"
}
)
# 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_FOw**********************************
This is your API token. Keep it to yourself.
Run topazlabs/image-upscale 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": {
"enhance_model": "Low Resolution V2",
"face_enhancement": true,
"face_enhancement_creativity": 0.5,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/MtnpGxNIVJlHAMZmQNl5bLARbYpiLahniAYis3RsRN2KwhfJ/out-1.webp",
"output_format": "jpg",
"subject_detection": "Foreground",
"upscale_factor": "4x"
}
}' \
https://api.replicate.com/v1/models/topazlabs/image-upscale/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Loading...
{
"id": "2b7abzyx1hrmc0cpdp6rz8mvjg",
"model": "topazlabs/image-upscale",
"version": "hidden",
"input": {
"enhance_model": "Low Resolution V2",
"face_enhancement": true,
"face_enhancement_creativity": 0.5,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/MtnpGxNIVJlHAMZmQNl5bLARbYpiLahniAYis3RsRN2KwhfJ/out-1.webp",
"output_format": "jpg",
"subject_detection": "Foreground",
"upscale_factor": "4x"
},
"logs": "Converted image from webp to jpeg\nGenerating...\nProcessed in 12.5sec\nCredits used: 1\nDownloading 2229037 bytes\nDownloaded 2.13MB in 0.17sec",
"output": "https://replicate.delivery/xezq/vXJDANfas80BdCZbLh06VSfeTtWCxdCB3TjgsVyxl0h5brMpA/tmp1orc4ro2.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-04-25T15:25:35.884Z",
"started_at": "2025-04-25T15:25:35.893913Z",
"completed_at": "2025-04-25T15:25:48.719207Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/2b7abzyx1hrmc0cpdp6rz8mvjg/cancel",
"get": "https://api.replicate.com/v1/predictions/2b7abzyx1hrmc0cpdp6rz8mvjg",
"stream": "https://stream.replicate.com/v1/files/bcwr-ine5brkltod6pxikhpnsg7st6rc63o3b3qeocz3mxqdxklwztp2a",
"web": "https://replicate.com/p/2b7abzyx1hrmc0cpdp6rz8mvjg"
},
"metrics": {
"image_count": 1,
"predict_time": 12.825293246,
"total_time": 12.835207
}
}