typefile
{
"enhance_model": "CGI",
"face_enhancement": false,
"face_enhancement_creativity": 0,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/Mtfss8QN14MF5lEERiMeVlxcneNfm8GEGd5A0IKbc2Ks4oi2/topaz.png",
"output_format": "jpg",
"subject_detection": "None",
"upscale_factor": "2x"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_8Go**********************************
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: "CGI",
face_enhancement: false,
face_enhancement_creativity: 0,
face_enhancement_strength: 0.8,
image: "https://replicate.delivery/pbxt/Mtfss8QN14MF5lEERiMeVlxcneNfm8GEGd5A0IKbc2Ks4oi2/topaz.png",
output_format: "jpg",
subject_detection: "None",
upscale_factor: "2x"
};
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_8Go**********************************
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": "CGI",
"face_enhancement": False,
"face_enhancement_creativity": 0,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/Mtfss8QN14MF5lEERiMeVlxcneNfm8GEGd5A0IKbc2Ks4oi2/topaz.png",
"output_format": "jpg",
"subject_detection": "None",
"upscale_factor": "2x"
}
)
# 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_8Go**********************************
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": "CGI",
"face_enhancement": false,
"face_enhancement_creativity": 0,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/Mtfss8QN14MF5lEERiMeVlxcneNfm8GEGd5A0IKbc2Ks4oi2/topaz.png",
"output_format": "jpg",
"subject_detection": "None",
"upscale_factor": "2x"
}
}' \
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": "sxqdnd1d7xrma0cpdes9ef9fc8",
"model": "topazlabs/image-upscale",
"version": "hidden",
"input": {
"enhance_model": "CGI",
"face_enhancement": false,
"face_enhancement_creativity": 0,
"face_enhancement_strength": 0.8,
"image": "https://replicate.delivery/pbxt/Mtfss8QN14MF5lEERiMeVlxcneNfm8GEGd5A0IKbc2Ks4oi2/topaz.png",
"output_format": "jpg",
"subject_detection": "None",
"upscale_factor": "2x"
},
"logs": "Generating...\nProcessed in 93.8sec\nCredits used: 1\nDownloading 4833909 bytes\nDownloaded 4.61MB in 0.20sec\n/usr/local/lib/python3.12/site-packages/cog/server/scope.py:21: ExperimentalFeatureWarning: current_scope is an experimental internal function. It may change or be removed without warning.\n warnings.warn(",
"output": "https://replicate.delivery/xezq/MzHCyd650VZ0Cx6ZID7YFU7WGg1J579C4ecwkhuvMH8DEHTKA/tmp9lnlmaoj.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-04-25T06:46:01.279Z",
"started_at": "2025-04-25T06:46:01.296718Z",
"completed_at": "2025-04-25T06:47:35.875964Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/sxqdnd1d7xrma0cpdes9ef9fc8/cancel",
"get": "https://api.replicate.com/v1/predictions/sxqdnd1d7xrma0cpdes9ef9fc8",
"stream": "https://stream.replicate.com/v1/files/bcwr-bzhe5wc4wpqphm72byrltotmtyqptnyex47gybqfjtauihu64ica",
"web": "https://replicate.com/p/sxqdnd1d7xrma0cpdes9ef9fc8"
},
"metrics": {
"image_count": 1,
"predict_time": 94.579246378,
"total_time": 94.596964
}
}