Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
sczhou /codeformer:7de2ea26
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run sczhou/codeformer using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"sczhou/codeformer:7de2ea26c616d5bf2245ad0d5e24f0ff9a6204578a5c876db53142edd9d2cd56",
{
input: {
image: "https://replicate.delivery/mgxm/9ff2825b-ad72-4aca-bf0a-a2cdf61f8068/1.png",
upscale: 2,
face_upsample: true,
background_enhance: true,
codeformer_fidelity: 0.2
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run sczhou/codeformer using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"sczhou/codeformer:7de2ea26c616d5bf2245ad0d5e24f0ff9a6204578a5c876db53142edd9d2cd56",
input={
"image": "https://replicate.delivery/mgxm/9ff2825b-ad72-4aca-bf0a-a2cdf61f8068/1.png",
"upscale": 2,
"face_upsample": True,
"background_enhance": True,
"codeformer_fidelity": 0.2
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run sczhou/codeformer 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": "sczhou/codeformer:7de2ea26c616d5bf2245ad0d5e24f0ff9a6204578a5c876db53142edd9d2cd56",
"input": {
"image": "https://replicate.delivery/mgxm/9ff2825b-ad72-4aca-bf0a-a2cdf61f8068/1.png",
"upscale": 2,
"face_upsample": true,
"background_enhance": true,
"codeformer_fidelity": 0.2
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
Loading...
{
"completed_at": "2022-09-11T07:49:19.171466Z",
"created_at": "2022-09-11T07:47:47.444236Z",
"data_removed": false,
"error": null,
"id": "3brtklnlxrh5dai63qnopzlwde",
"input": {
"image": "https://replicate.delivery/mgxm/9ff2825b-ad72-4aca-bf0a-a2cdf61f8068/1.png",
"upscale": 2,
"face_upsample": true,
"background_enhance": true,
"codeformer_fidelity": "0.2"
},
"logs": "\tdetect 2 faces",
"metrics": {
"predict_time": 5.567838,
"total_time": 91.72723
},
"output": "https://replicate.delivery/mgxm/3d919864-699f-41eb-9202-67eae3cab055/output.png",
"started_at": "2022-09-11T07:49:13.603628Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/3brtklnlxrh5dai63qnopzlwde",
"cancel": "https://api.replicate.com/v1/predictions/3brtklnlxrh5dai63qnopzlwde/cancel"
},
"version": "7de2ea26c616d5bf2245ad0d5e24f0ff9a6204578a5c876db53142edd9d2cd56"
}
detect 2 faces