Live Portrait video to video

Experience the magic of Live Portrait’s Video-to-Video Model! Transform your static images into dynamic videos seamlessly.

~74.29s
~$0.279
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/live-portrait-video-to-video"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "input_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/live_portrait_v2v_input_vid.mp4",
12    "driving_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/livie_portrait_driving_vid.mp4",
13    "dsize": 512,
14    "scale": 2.3,
15    "driving_audio": false,
16    "vx_ratio": 0,
17    "vy_ratio": -0.125,
18    "input_face_index": 0,
19    "drive_face_index": 0,
20    "crop_drive_face": false,
21    "lip_zero": true,
22    "lip_zero_threshold": 0.03,
23    "eye_retargeting": false,
24    "eyes_retargeting_multiplier": 1,
25    "lip_retargeting": false,
26    "lip_retargeting_multiplier": 1,
27    "stitching": true,
28    "relative": true,
29    "mismatch_method": "cut",
30    "video_frame_load_cap": 120,
31    "base64": false
32}
33
34response = requests.post(url, headers=headers, json=data)
35
36if response.status_code == 200:
37    result = response.json()
38    print(json.dumps(result, indent=2))
39else:
40    print(f"Error: {response.status_code}")
41    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/live-portrait-video-to-video

Parameters

drive_face_indexrequired
integer

Index of the driving face

Default: 0Range: 0 - 5
driving_videorequired
string (uri)

Driving video

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/livie_portrait_driving_vid.mp4"
dsizerequired
integer

Size of the video

Default: 512Range: 64 - 2048
input_face_indexrequired
integer

Index of the input face

Default: 0Range: 0 - 5
input_videorequired
string (uri)

Input video

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/live_portrait_v2v_input_vid.mp4"
mismatch_methodrequired
string

Method for mismatch handling

Default: "cut"
Allowed values :
"cut""circle""none"
scalerequired
number

Scale of the video

Default: 2.3Range: 1 - 4
video_frame_load_caprequired
integer

The maximum number of frames to load from the driving video. Set to 0 to use all frames.

Default: 120
base64optional
boolean

Base64 encoding of the output image.

Default: false
crop_drive_faceoptional
boolean

Crop the driving face

Default: false
driving_audiooptional
boolean

Set to 'true' to return the audio of the driving video; if 'false', the audio of input video will be returned.

Default: false
eye_retargetingoptional
boolean

Enable eye retargeting

Default: false
eyes_retargeting_multiplieroptional
number

Multiplier for eye retargeting

Default: 1Range: 0.01 - 10
lip_retargetingoptional
boolean

Enable lip retargeting

Default: false
lip_retargeting_multiplieroptional
number

Multiplier for lip retargeting

Default: 1Range: 0.01 - 10
lip_zerooptional
boolean

Zero out the lips

Default: true
lip_zero_thresholdoptional
number

Threshold for zeroing out the lips

Default: 0.03Range: 0 - 5
relativeoptional
boolean

Use relative method

Default: true
stitchingoptional
boolean

Enable stitching

Default: true
vx_ratiooptional
number

Horizontal ratio for transformation

Default: 0Range: -1 - 1
vy_ratiooptional
number

Vertical ratio for transformation

Default: -0.125Range: -1 - 1

Response Type

Returns: Video

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out