tencentarc/gfpgan

Practical face restoration algorithm for *old photos* or *AI-generated faces*

Blind Face Restoration with Vector-Quantized Dictionary and Parallel Decoder
Real-World Super-Resolution Models for Animation Videos

Create photos, paintings and avatars for anyone in any style within seconds.

Create photos, paintings and avatars for anyone in any style within seconds. (Stylization version)

Practical face restoration algorithm for *old photos* or *AI-generated faces*
Prediction
tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694Input
{ "img": "https://replicate.delivery/mgxm/9227bd4f-a945-44d7-956a-dee33c6f389f/%E4%B8%8B%E8%BD%BD.jpg", "scale": 2, "version": "v1.3" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", { input: { img: "https://replicate.delivery/mgxm/9227bd4f-a945-44d7-956a-dee33c6f389f/%E4%B8%8B%E8%BD%BD.jpg", scale: 2, version: "v1.3" } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", input={ "img": "https://replicate.delivery/mgxm/9227bd4f-a945-44d7-956a-dee33c6f389f/%E4%B8%8B%E8%BD%BD.jpg", "scale": 2, "version": "v1.3" } ) # 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.
Run tencentarc/gfpgan 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": "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", "input": { "img": "https://replicate.delivery/mgxm/9227bd4f-a945-44d7-956a-dee33c6f389f/%E4%B8%8B%E8%BD%BD.jpg", "scale": 2, "version": "v1.3" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Loading...
{ "completed_at": "2022-08-31T06:54:02.888434Z", "created_at": "2022-08-31T06:54:00.041386Z", "data_removed": false, "error": null, "id": "wdj2fedsczdtzeflmvzyu4hata", "input": { "img": "https://replicate.delivery/mgxm/9227bd4f-a945-44d7-956a-dee33c6f389f/%E4%B8%8B%E8%BD%BD.jpg", "scale": 2, "version": "v1.3" }, "logs": null, "metrics": { "predict_time": 0.000004, "total_time": 2.847048 }, "output": "https://replicate.delivery/mgxm/25b4bcb2-3029-4417-8689-e5997f217ea0/output.png", "started_at": "2022-08-31T06:54:02.888430Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/wdj2fedsczdtzeflmvzyu4hata", "cancel": "https://api.replicate.com/v1/predictions/wdj2fedsczdtzeflmvzyu4hata/cancel" }, "version": "ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694" }
Prediction
tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694Input
{ "img": "https://replicate.delivery/mgxm/6c1f5af2-825c-4ded-a4c1-339a58a0347c/187400981-8a58f7a4-ef61-42d9-af80-bc6234cef860.jpg", "scale": 2, "version": "v1.3" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", { input: { img: "https://replicate.delivery/mgxm/6c1f5af2-825c-4ded-a4c1-339a58a0347c/187400981-8a58f7a4-ef61-42d9-af80-bc6234cef860.jpg", scale: 2, version: "v1.3" } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", input={ "img": "https://replicate.delivery/mgxm/6c1f5af2-825c-4ded-a4c1-339a58a0347c/187400981-8a58f7a4-ef61-42d9-af80-bc6234cef860.jpg", "scale": 2, "version": "v1.3" } ) # 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.
Run tencentarc/gfpgan 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": "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", "input": { "img": "https://replicate.delivery/mgxm/6c1f5af2-825c-4ded-a4c1-339a58a0347c/187400981-8a58f7a4-ef61-42d9-af80-bc6234cef860.jpg", "scale": 2, "version": "v1.3" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Loading...
{ "completed_at": "2022-08-31T08:10:19.978081Z", "created_at": "2022-08-31T08:10:12.625729Z", "data_removed": false, "error": null, "id": "ya2he2bwmjdaxb2mg2fwj4ejn4", "input": { "img": "https://replicate.delivery/mgxm/6c1f5af2-825c-4ded-a4c1-339a58a0347c/187400981-8a58f7a4-ef61-42d9-af80-bc6234cef860.jpg", "scale": 2, "version": "v1.3" }, "logs": null, "metrics": { "predict_time": 0.580283, "total_time": 7.352352 }, "output": "https://replicate.delivery/mgxm/abab834a-81ec-42f1-a415-7035ae55707a/output.png", "started_at": "2022-08-31T08:10:19.397798Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/ya2he2bwmjdaxb2mg2fwj4ejn4", "cancel": "https://api.replicate.com/v1/predictions/ya2he2bwmjdaxb2mg2fwj4ejn4/cancel" }, "version": "ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694" }
Prediction
tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694Input
{ "img": "https://replicate.delivery/mgxm/26d87fc6-3843-4680-9f92-9970de2e5a61/187401133-8a3bf269-5b4d-4432-b2f0-6d26ee1d3307.png", "scale": 2, "version": "v1.3" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", { input: { img: "https://replicate.delivery/mgxm/26d87fc6-3843-4680-9f92-9970de2e5a61/187401133-8a3bf269-5b4d-4432-b2f0-6d26ee1d3307.png", scale: 2, version: "v1.3" } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", input={ "img": "https://replicate.delivery/mgxm/26d87fc6-3843-4680-9f92-9970de2e5a61/187401133-8a3bf269-5b4d-4432-b2f0-6d26ee1d3307.png", "scale": 2, "version": "v1.3" } ) # 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.
Run tencentarc/gfpgan 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": "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", "input": { "img": "https://replicate.delivery/mgxm/26d87fc6-3843-4680-9f92-9970de2e5a61/187401133-8a3bf269-5b4d-4432-b2f0-6d26ee1d3307.png", "scale": 2, "version": "v1.3" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Loading...
{ "completed_at": "2022-08-31T08:11:17.026834Z", "created_at": "2022-08-31T08:11:07.463867Z", "data_removed": false, "error": null, "id": "xpyncbsrhzavpdjjpwzwi5cf5q", "input": { "img": "https://replicate.delivery/mgxm/26d87fc6-3843-4680-9f92-9970de2e5a61/187401133-8a3bf269-5b4d-4432-b2f0-6d26ee1d3307.png", "scale": 2, "version": "v1.3" }, "logs": null, "metrics": { "predict_time": 5.299165, "total_time": 9.562967 }, "output": "https://replicate.delivery/mgxm/4fbbce6e-daa9-45c0-bdf1-1c14ade7fdeb/output.png", "started_at": "2022-08-31T08:11:11.727669Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/xpyncbsrhzavpdjjpwzwi5cf5q", "cancel": "https://api.replicate.com/v1/predictions/xpyncbsrhzavpdjjpwzwi5cf5q/cancel" }, "version": "ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694" }
Prediction
tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694Input
{ "img": "https://replicate.delivery/mgxm/57dae5a1-f11b-4f41-83ec-a2c9ac190c69/AAA9hAAAPYQGoP6dpAAAKT2lD.png", "scale": 2, "version": "v1.3" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", { input: { img: "https://replicate.delivery/mgxm/57dae5a1-f11b-4f41-83ec-a2c9ac190c69/AAA9hAAAPYQGoP6dpAAAKT2lD.png", scale: 2, version: "v1.3" } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", input={ "img": "https://replicate.delivery/mgxm/57dae5a1-f11b-4f41-83ec-a2c9ac190c69/AAA9hAAAPYQGoP6dpAAAKT2lD.png", "scale": 2, "version": "v1.3" } ) # 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.
Run tencentarc/gfpgan 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": "tencentarc/gfpgan:ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694", "input": { "img": "https://replicate.delivery/mgxm/57dae5a1-f11b-4f41-83ec-a2c9ac190c69/AAA9hAAAPYQGoP6dpAAAKT2lD.png", "scale": 2, "version": "v1.3" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Loading...
{ "completed_at": "2022-08-31T08:15:10.543965Z", "created_at": "2022-08-31T08:15:07.183010Z", "data_removed": false, "error": null, "id": "2j4duq3vbfbblgd7jqx5xrcngi", "input": { "img": "https://replicate.delivery/mgxm/57dae5a1-f11b-4f41-83ec-a2c9ac190c69/AAA9hAAAPYQGoP6dpAAAKT2lD.png", "scale": 2, "version": "v1.3" }, "logs": null, "metrics": { "predict_time": 1.809755, "total_time": 3.360955 }, "output": "https://replicate.delivery/mgxm/9788da2f-4f0c-4107-b6de-6c9332cc3af2/output.png", "started_at": "2022-08-31T08:15:08.734210Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/2j4duq3vbfbblgd7jqx5xrcngi", "cancel": "https://api.replicate.com/v1/predictions/2j4duq3vbfbblgd7jqx5xrcngi/cancel" }, "version": "ae80bbe1adce7d616b8a96ba88a91d3556838d4f2f4da76327638b8e95ea4694" }
Prediction
tencentarc/gfpgan:297a243ce8643961d52f745f9b6c8c1bd96850a51c92be5f43628a0d3e08321aInput
{ "img": "https://replicate.delivery/mgxm/59d9390c-b415-47e0-a907-f81b0d9920f1/187400315-87a90ac9-d231-45d6-b377-38702bd1838f.jpg", "scale": 2, "version": "v1.4" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "tencentarc/gfpgan:297a243ce8643961d52f745f9b6c8c1bd96850a51c92be5f43628a0d3e08321a", { input: { img: "https://replicate.delivery/mgxm/59d9390c-b415-47e0-a907-f81b0d9920f1/187400315-87a90ac9-d231-45d6-b377-38702bd1838f.jpg", scale: 2, version: "v1.4" } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run tencentarc/gfpgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "tencentarc/gfpgan:297a243ce8643961d52f745f9b6c8c1bd96850a51c92be5f43628a0d3e08321a", input={ "img": "https://replicate.delivery/mgxm/59d9390c-b415-47e0-a907-f81b0d9920f1/187400315-87a90ac9-d231-45d6-b377-38702bd1838f.jpg", "scale": 2, "version": "v1.4" } ) # 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.
Run tencentarc/gfpgan 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": "tencentarc/gfpgan:297a243ce8643961d52f745f9b6c8c1bd96850a51c92be5f43628a0d3e08321a", "input": { "img": "https://replicate.delivery/mgxm/59d9390c-b415-47e0-a907-f81b0d9920f1/187400315-87a90ac9-d231-45d6-b377-38702bd1838f.jpg", "scale": 2, "version": "v1.4" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Loading...
{ "completed_at": "2022-09-04T15:41:29.906994Z", "created_at": "2022-09-04T15:41:27.941644Z", "data_removed": false, "error": null, "id": "ffu2e6aw4barxliwxu23ydgbnu", "input": { "img": "https://replicate.delivery/mgxm/59d9390c-b415-47e0-a907-f81b0d9920f1/187400315-87a90ac9-d231-45d6-b377-38702bd1838f.jpg", "scale": 2, "version": "v1.4" }, "logs": "/tmp/tmpky22vsq_187400315-87a90ac9-d231-45d6-b377-38702bd1838f.jpg v1.4 2.0", "metrics": { "predict_time": 1.674856, "total_time": 1.96535 }, "output": "https://replicate.delivery/mgxm/85f53415-0dc7-4703-891f-1e6f912119ad/output.png", "started_at": "2022-09-04T15:41:28.232138Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/ffu2e6aw4barxliwxu23ydgbnu", "cancel": "https://api.replicate.com/v1/predictions/ffu2e6aw4barxliwxu23ydgbnu/cancel" }, "version": "297a243ce8643961d52f745f9b6c8c1bd96850a51c92be5f43628a0d3e08321a" }
Generated in/tmp/tmpky22vsq_187400315-87a90ac9-d231-45d6-b377-38702bd1838f.jpg v1.4 2.0
Want to make some of these yourself?
Run this model