Live Portrait video to video Serverless API
Experience the magic of Live Portrait’s Video-to-Video Model! Transform your static images into dynamic videos seamlessly.
POST /v2/live-portrait-video-to-video · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "input_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/live_portrait_v2v_input_vid.mp4",
11 "driving_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/livie_portrait_driving_vid.mp4",
12 "dsize": 512,
13 "scale": 2.3,
14 "driving_audio": False,
15 "vx_ratio": 0,
16 "vy_ratio": -0.125,
17 "input_face_index": 0,
18 "drive_face_index": 0,
19 "crop_drive_face": False,
20 "lip_zero": True,
21 "lip_zero_threshold": 0.03,
22 "eye_retargeting": False,
23 "eyes_retargeting_multiplier": 1,
24 "lip_retargeting": False,
25 "lip_retargeting_multiplier": 1,
26 "stitching": True,
27 "relative": True,
28 "mismatch_method": "cut",
29 "video_frame_load_cap": 120,
30 "base64": False,
31}
32job = client.submit_async("live-portrait-video-to-video", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=900, interval=2.0)
36 print(result["status"]) # COMPLETED
37 print(result.get("output")) # model output (e.g. video URL)
38except InferenceTimeout as e:
39 print("still running:", e.request_id) # re-poll later with this id
40except InferenceFailed as e:
41 print("failed:", e.detail)
42
43# Fast models (<=600s) can use the one-liner instead:
44# result = segmind.run("live-portrait-video-to-video", **payload) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "input_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/live_portrait_v2v_input_vid.mp4",
11 "driving_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/livie_portrait_driving_vid.mp4",
12 "dsize": 512,
13 "scale": 2.3,
14 "driving_audio": False,
15 "vx_ratio": 0,
16 "vy_ratio": -0.125,
17 "input_face_index": 0,
18 "drive_face_index": 0,
19 "crop_drive_face": False,
20 "lip_zero": True,
21 "lip_zero_threshold": 0.03,
22 "eye_retargeting": False,
23 "eyes_retargeting_multiplier": 1,
24 "lip_retargeting": False,
25 "lip_retargeting_multiplier": 1,
26 "stitching": True,
27 "relative": True,
28 "mismatch_method": "cut",
29 "video_frame_load_cap": 120,
30 "base64": False,
31}
32job = client.submit_async("live-portrait-video-to-video", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=900, interval=2.0)
36 print(result["status"]) # COMPLETED
37 print(result.get("output")) # model output (e.g. video URL)
38except InferenceTimeout as e:
39 print("still running:", e.request_id) # re-poll later with this id
40except InferenceFailed as e:
41 print("failed:", e.detail)
42
43# Fast models (<=600s) can use the one-liner instead:
44# result = segmind.run("live-portrait-video-to-video", **payload)API Endpoint
https://api.segmind.com/v1/live-portrait-video-to-videoParameters
drive_face_indexrequiredintegerIndex of the driving face
0Range: 0 - 5driving_videorequiredstring (uri)Driving video
"https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/livie_portrait_driving_vid.mp4"dsizerequiredintegerSize of the video
512Range: 64 - 2048input_face_indexrequiredintegerIndex of the input face
0Range: 0 - 5input_videorequiredstring (uri)Input video
"https://segmind-sd-models.s3.amazonaws.com/display_images/live-portrait-v2v/live_portrait_v2v_input_vid.mp4"mismatch_methodrequiredstringMethod for mismatch handling
"cut""cut""circle""none"scalerequirednumberScale of the video
2.3Range: 1 - 4video_frame_load_caprequiredintegerThe maximum number of frames to load from the driving video. Set to 0 to use all frames.
120base64optionalbooleanBase64 encoding of the output image.
falsecrop_drive_faceoptionalbooleanCrop the driving face
falsedriving_audiooptionalbooleanSet to 'true' to return the audio of the driving video; if 'false', the audio of input video will be returned.
falseeye_retargetingoptionalbooleanEnable eye retargeting
falseeyes_retargeting_multiplieroptionalnumberMultiplier for eye retargeting
1Range: 0.01 - 10lip_retargetingoptionalbooleanEnable lip retargeting
falselip_retargeting_multiplieroptionalnumberMultiplier for lip retargeting
1Range: 0.01 - 10lip_zerooptionalbooleanZero out the lips
truelip_zero_thresholdoptionalnumberThreshold for zeroing out the lips
0.03Range: 0 - 5relativeoptionalbooleanUse relative method
truestitchingoptionalbooleanEnable stitching
truevx_ratiooptionalnumberHorizontal ratio for transformation
0Range: -1 - 1vy_ratiooptionalnumberVertical ratio for transformation
-0.125Range: -1 - 1Response Type
Returns: Video
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/live-portrait-video-to-videoSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out