Pruna P Video Avatar Serverless API

Animate any portrait into a lip-synced talking avatar.

~98.10s
POST /v2/p-video-avatar · 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    "image": "https://segmind-resources.s3.amazonaws.com/input/p-video-avatar-input-portrait.jpg",
11    "voice_script": "Hi there! Welcome to Segmind, where a single photo becomes a lifelike, lip-synced talking avatar.",
12    "voice": "Zephyr (Female)",
13    "resolution": "720p",
14    "voice_language": "English (US)",
15    "video_prompt": "The person is talking to the camera with natural head movement and expressions.",
16    "voice_prompt": "Speak in a warm, friendly and welcoming tone.",
17    "negative_prompt": "subtitles, text, watermark, blurry, distorted face, extra fingers",
18    "strength_negative_prompt": 0.5,
19    "seed": 42,
20    "disable_safety_filter": True,
21    "disable_prompt_upsampling": False,
22}
23job = client.submit_async("p-video-avatar", **payload)
24print(job.request_id)                         # available immediately
25try:
26    result = job.wait(timeout=900, interval=2.0)
27    print(result["status"])                  # COMPLETED
28    print(result.get("output"))              # model output (e.g. video URL)
29except InferenceTimeout as e:
30    print("still running:", e.request_id)    # re-poll later with this id
31except InferenceFailed as e:
32    print("failed:", e.detail)
33
34# Fast models (<=600s) can use the one-liner instead:
35# result = segmind.run("p-video-avatar", **payload)

API Endpoint

POSThttps://api.segmind.com/v1/p-video-avatar

Parameters

imagerequired
string (uri)

First-frame portrait in jpg, jpeg, png or webp. Use clean, front-facing headshots.

audiooptional
string (uri)

Audio URL to lip-sync; overrides voice_script. Upload clean, music-free voice recordings.

disable_prompt_upsamplingoptional
boolean

Skips prompt enhancement when true. Enable for exact, literal prompt wording.

Default: false
disable_safety_filteroptional
boolean

Toggles safety checks on prompts and image. Leave default unless needed.

Default: true
negative_promptoptional
string

Lists what to avoid in the video. Try subtitles, blurry, watermark.

Default: ""
resolutionoptional
string

Output resolution, 720p or 1080p. Use 720p to iterate, 1080p for finals.

Default: "720p"
Allowed values :
"720p""1080p"
seedoptional
integer

Random seed for reproducibility. Reuse a seed to repeat a result.

Default: nullRange: -1 - 999999999999999
strength_negative_promptoptional
number

Negative-prompt intensity from 0 to 4. Start near 0.5 and adjust.

Default: 0.5Range: 0 - 4
video_promptoptional
string

Describes framing, motion and background. Keep simple; fixed camera aids lip-sync.

Default: "The person is talking."
voiceoptional
string

One of 30 built-in TTS voices, used with voice_script. Match speaker gender.

Default: "Zephyr (Female)"
Allowed values (30 total):
"Zephyr (Female)""Puck (Male)""Charon (Male)""Kore (Female)""Fenrir (Male)""Leda (Female)""Orus (Male)""Aoede (Female)""Callirrhoe (Female)""Autonoe (Female)"+20 more
voice_languageoptional
string

Speech language for voice_script, ten options. Set it to match your script.

Default: "English (US)"
Allowed values :
"English (US)""English (UK)""Spanish""French""German""Italian""Portuguese (Brazil)""Japanese""Korean""Hindi"
voice_promptoptional
string

Sets tone, pace and emotion, not the words. Try warm, confident, energetic.

Default: "Say the following."
voice_scriptoptional
string

Text the avatar speaks when no audio is supplied. Keep sentences short.

Default: "Hi there! Welcome to Segmind, where a single photo becomes a lifelike, lip-synced talking avatar."

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/p-video-avatar

    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