POST
/
v3
/
async
/
video-merge-face

This API endpoint seamlessly integrates a face image into a target video, allowing you to replace the face in the video with the face from the image.

Pricing: $0.0005 / Video Frame

Request Headers

Content-Type
string
required

Enum: application/json

Authorization
string
required

Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

extra
object

Optional extra parameters for the request.

request
object
required
video_assets_id
string
required

Upload your input video to our temporary secure storage following the instructions in the guide Get video assets id, and the video_assets_id is the identifier for your input video. Supported video formats: MP4, with a maximum resolution of 3840 x 2160 and a maximum file size of 100 Mb.

enable_restore
boolean
required

Whether to restore the output face image. If enabled, the output face video will be more detailed, but the API latency will be longer.

face_image_base64
string
required

The base64-encoded face image, with a maximum resolution of 2048 x 2048 and a maximum file size of 30 MB.

Response

task_id
string

Use the task_id to request the Task Result API to retrieve the generated outputs.

Example

1. Get Video Assets ID

Request:

curl -X PUT -T "{{video file path}}" 'https://assets.novitai.com/video'

Response:

{
    "assets_id": "cjIvbm92aXRhLWFpLWFzc2V0L3ZpZGVvL0NLd0N3aHJwS0ZyYVduNWVoejVFV0tleGlzN0toNmRq"
}

Was this page helpful?