typefile
{
"aaa": 0,
"blink": 0,
"crop_factor": 1.7,
"eee": 0,
"eyebrow": 0,
"image": "https://replicate.delivery/pbxt/Lg7pzAsHjoZlGHtrfI4wnVZchV8G9XCyXXMG37YMyb4NoBiU/PhotoMaker_00001_.png",
"output_format": "webp",
"output_quality": 95,
"pupil_x": 13.46,
"pupil_y": 0,
"rotate_pitch": 10.54,
"rotate_roll": 0,
"rotate_yaw": 0,
"sample_ratio": 1,
"smile": 0,
"src_ratio": 1,
"wink": 0,
"woo": 0
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_3NY**********************************
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 fofr/expression-editor using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"fofr/expression-editor:949a601adf95ade48a3b34379e513a29f84b95c73a13fbb2478627f46f829f2c",
{
input: {
aaa: 0,
blink: 0,
crop_factor: 1.7,
eee: 0,
eyebrow: 0,
image: "https://replicate.delivery/pbxt/Lg7pzAsHjoZlGHtrfI4wnVZchV8G9XCyXXMG37YMyb4NoBiU/PhotoMaker_00001_.png",
output_format: "webp",
output_quality: 95,
pupil_x: 13.46,
pupil_y: 0,
rotate_pitch: 10.54,
rotate_roll: 0,
rotate_yaw: 0,
sample_ratio: 1,
smile: 0,
src_ratio: 1,
wink: 0,
woo: 0
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_3NY**********************************
This is your API token. Keep it to yourself.
import replicate
Run fofr/expression-editor using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/expression-editor:949a601adf95ade48a3b34379e513a29f84b95c73a13fbb2478627f46f829f2c",
input={
"aaa": 0,
"blink": 0,
"crop_factor": 1.7,
"eee": 0,
"eyebrow": 0,
"image": "https://replicate.delivery/pbxt/Lg7pzAsHjoZlGHtrfI4wnVZchV8G9XCyXXMG37YMyb4NoBiU/PhotoMaker_00001_.png",
"output_format": "webp",
"output_quality": 95,
"pupil_x": 13.46,
"pupil_y": 0,
"rotate_pitch": 10.54,
"rotate_roll": 0,
"rotate_yaw": 0,
"sample_ratio": 1,
"smile": 0,
"src_ratio": 1,
"wink": 0,
"woo": 0
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].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_3NY**********************************
This is your API token. Keep it to yourself.
Run fofr/expression-editor 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": "fofr/expression-editor:949a601adf95ade48a3b34379e513a29f84b95c73a13fbb2478627f46f829f2c",
"input": {
"aaa": 0,
"blink": 0,
"crop_factor": 1.7,
"eee": 0,
"eyebrow": 0,
"image": "https://replicate.delivery/pbxt/Lg7pzAsHjoZlGHtrfI4wnVZchV8G9XCyXXMG37YMyb4NoBiU/PhotoMaker_00001_.png",
"output_format": "webp",
"output_quality": 95,
"pupil_x": 13.46,
"pupil_y": 0,
"rotate_pitch": 10.54,
"rotate_roll": 0,
"rotate_yaw": 0,
"sample_ratio": 1,
"smile": 0,
"src_ratio": 1,
"wink": 0,
"woo": 0
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "s5kb46521nrj60cj4ecr2at1p4",
"model": "fofr/expression-editor",
"version": "949a601adf95ade48a3b34379e513a29f84b95c73a13fbb2478627f46f829f2c",
"input": {
"aaa": 0,
"blink": 0,
"crop_factor": 1.7,
"eee": 0,
"eyebrow": 0,
"image": "https://replicate.delivery/pbxt/Lg7pzAsHjoZlGHtrfI4wnVZchV8G9XCyXXMG37YMyb4NoBiU/PhotoMaker_00001_.png",
"output_format": "webp",
"output_quality": 95,
"pupil_x": 13.46,
"pupil_y": 0,
"rotate_pitch": 10.54,
"rotate_roll": 0,
"rotate_yaw": 0,
"sample_ratio": 1,
"smile": 0,
"src_ratio": 1,
"wink": 0,
"woo": 0
},
"logs": "Running workflow\n[ComfyUI] got prompt\nExecuting node 14, title: Expression Editor (PHM), class type: ExpressionEditor\n[ComfyUI] Prompt executed in 0.09 seconds\noutputs: {'14': {'images': [{'filename': 'expression_edit_preview4.png', 'type': 'temp'}]}}\n====================================\nexpression_edit_preview4.png",
"output": [
"https://replicate.delivery/yhqm/xkxWbasYQhZGKlfJqkz3UUAQj5LTqedA6EVppFWDGV2sfIAnA/expression_edit_preview4.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-24T10:35:24.045Z",
"started_at": "2024-09-24T10:35:24.055529Z",
"completed_at": "2024-09-24T10:35:24.836739Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/s5kb46521nrj60cj4ecr2at1p4/cancel",
"get": "https://api.replicate.com/v1/predictions/s5kb46521nrj60cj4ecr2at1p4",
"web": "https://replicate.com/p/s5kb46521nrj60cj4ecr2at1p4"
},
"metrics": {
"predict_time": 0.781210154,
"total_time": 0.791739
}
}
