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.
input image
choose image editing option
Default: "smile"
control the degree of editing (valid for 'age' and 'smile').
Default: 0
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
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 tengfei-wang/hfgi using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "tengfei-wang/hfgi:7a67b1861633a89e4ba600d39dd4cb447ce06091833cc9df13ecdb078c1e3f64", { input: { image: "https://replicate.delivery/mgxm/caf4c15f-fe0e-406a-a62b-f2700f427910/00044.jpg", edit_degree: 1.5, edit_attribute: "smile" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
import replicate
output = replicate.run( "tengfei-wang/hfgi:7a67b1861633a89e4ba600d39dd4cb447ce06091833cc9df13ecdb078c1e3f64", input={ "image": "https://replicate.delivery/mgxm/caf4c15f-fe0e-406a-a62b-f2700f427910/00044.jpg", "edit_degree": 1.5, "edit_attribute": "smile" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "7a67b1861633a89e4ba600d39dd4cb447ce06091833cc9df13ecdb078c1e3f64", "input": { "image": "https://replicate.delivery/mgxm/caf4c15f-fe0e-406a-a62b-f2700f427910/00044.jpg", "edit_degree": 1.5, "edit_attribute": "smile" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{ "completed_at": "2021-11-04T13:43:28.781826Z", "created_at": "2021-11-04T13:43:25.909851Z", "data_removed": false, "error": null, "id": "p5tqlw47jjhjdovxz33zhl3fva", "input": { "image": "https://replicate.delivery/mgxm/caf4c15f-fe0e-406a-a62b-f2700f427910/00044.jpg", "edit_degree": "1.5", "edit_attribute": "smile" }, "logs": "Aligned image has shape: (256, 256)", "metrics": { "total_time": 2.871975 }, "output": [ { "file": "https://replicate.delivery/mgxm/bd5bccb0-b834-4f03-817b-393c7d30175d/out.png" } ], "started_at": "2021-11-30T19:33:09.650036Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/p5tqlw47jjhjdovxz33zhl3fva", "cancel": "https://api.replicate.com/v1/predictions/p5tqlw47jjhjdovxz33zhl3fva/cancel" }, "version": "1e8ae7ea785ea246208c3db592ee3eb16db0be0daaa11c935f8ef270ed810895" }
Aligned image has shape: (256, 256)
This example was created by a different version, tengfei-wang/hfgi:1e8ae7ea.
Choose a file from your machine
Hint: you can also drag files onto the input