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.

~74.56s
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)

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

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. 1
    POST /v2/live-portrait-video-to-video

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • 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.

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