Face Swap
https://api.imaginepro.ai/api/v1/midjourney/faceswap
You can perform a face swap from one image to another. Both images must contain one face, otherwise it will only take the left most face as input.
For faceswap in group photo or video, you can check the specific ChangeFace service.
- Please make sure the image is not huge, file size less than 5MB is recommended.
POST /api/v1/midjourney/faceswap
Sample Request
{
"source": "https://pix2.tvzhe.com/thumb/star/0/121/260x346.jpg",
"target": "https://pix2.tvzhe.com/thumb/star/0/202/260x346.jpg"
}
Request Body
Name | Type | Required | Description |
---|---|---|---|
source | string | yes | This is the URL for the face that you would like to use on the target. You cannot use URLS served by Midjourney (ie. cdn.midjourney) image. |
target | string | yes | This is the URL for the image that you would like to swap the face on. You cannot use URLS served by Midjourney (ie. cdn.midjourney) image. |
webhookOverride | string | no | the webhook you would like to receive the progress, etc |
ref | string | no | none |
source
This is the URL for the face that you would like to use on the target. You cannot use URLS served by Midjourney (ie. cdn.midjourney) image. If you don't know where to upload your image, you can use this tool (opens in a new tab) to upload your image to our server, and copy the image URL.
target
This is the URL for the image that you would like to swap the face on. You cannot use URLS served by Midjourney (ie. cdn.midjourney) image. If you don't know where to upload your image, you can use this tool (opens in a new tab) to upload your image to our server, and copy the image URL.
ref (optional)
You can optionally pass ref
in your command - which can be used useful when using webhooks You might want to do this to pass some simple metadata through to your webhook.
webhookOverride (optional)
You can optionally pass webhookOverride
that will route a response to a webhook of your choosing. Please note that using a webhook is completely optional. You are welcome to use the GET Message endpoint to retrieve responses.
Sample Response
{
"success": true,
"messageId": "your-message-id",
"createdAt": "2023-08-01T14:03:01.817Z"
}
Response Body
Name | Type | Description |
---|---|---|
success | boolean | a boolean value for the generation job creation status |
messageId | string | the messageId for querying the progress later |
createdAt | string | timestamp of the task creation |
error | string | error message if any |
Examples
const axios = require("axios")
const config = {
method: "post",
url: "https://api.imaginepro.ai/api/v1/midjourney/faceswap",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <your-token>",
},
data: {
source: "https://pix2.tvzhe.com/thumb/star/0/121/260x346.jpg",
target: "https://pix2.tvzhe.com/thumb/star/0/202/260x346.jpg",
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})