Pruna P Video 2 Pro Avatar API
Turn a portrait and speech into a lip-synced talking video, from an audio file or a typed script.
POST /v2/p-video-2-pro-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 "voice_language": "English (US)",
14 "resolution": "768p",
15 "prompt": "The person is talking.",
16 "prompt_upsampling": True,
17 "voice_prompt": "Say the following.",
18 "seed": -1,
19}
20job = client.submit_async("p-video-2-pro-avatar", **payload)
21print(job.request_id) # available immediately
22try:
23 result = job.wait(timeout=900, interval=2.0)
24 print(result["status"]) # COMPLETED
25 print(result.get("output")) # model output (e.g. video URL)
26except InferenceTimeout as e:
27 print("still running:", e.request_id) # re-poll later with this id
28except InferenceFailed as e:
29 print("failed:", e.detail)
30
31# Fast models (<=600s) can use the one-liner instead:
32# result = segmind.run("p-video-2-pro-avatar", **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 "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 "voice_language": "English (US)",
14 "resolution": "768p",
15 "prompt": "The person is talking.",
16 "prompt_upsampling": True,
17 "voice_prompt": "Say the following.",
18 "seed": -1,
19}
20job = client.submit_async("p-video-2-pro-avatar", **payload)
21print(job.request_id) # available immediately
22try:
23 result = job.wait(timeout=900, interval=2.0)
24 print(result["status"]) # COMPLETED
25 print(result.get("output")) # model output (e.g. video URL)
26except InferenceTimeout as e:
27 print("still running:", e.request_id) # re-poll later with this id
28except InferenceFailed as e:
29 print("failed:", e.detail)
30
31# Fast models (<=600s) can use the one-liner instead:
32# result = segmind.run("p-video-2-pro-avatar", **payload)API Endpoint
https://api.segmind.com/v1/p-video-2-pro-avatarParameters
imagerequiredstring (uri)First-frame portrait in jpg, jpeg, png or webp, up to 20 MiB. The portrait sets the aspect ratio; use a clean, front-facing headshot.
audiooptionalstring (uri)Speech to lip-sync, up to 64 MiB and 3 minutes; the video matches its length. Overrides voice_script when both are set. Audio under 1 second is rejected.
promptoptionalstringWhat the video should show besides the speech, such as gestures or expression.
"The person is talking."prompt_upsamplingoptionalbooleanAppends the portrait's own scene motion to your prompt; your words stay first. Set false to use the prompt exactly as written. No price change.
trueresolutionoptionalstringOutput resolution. 768p costs twice as much per second of video as 480p.
"768p""480p""768p"seedoptionalintegerFixed seed for reproducible output. Use -1 for a new random result each run.
-1Range: -1 - 2147483647voiceoptionalstringTTS voice for voice_script, 30 options; each name carries (Female) or (Male).
"Zephyr (Female)""Zephyr (Female)""Puck (Male)""Charon (Male)""Kore (Female)""Fenrir (Male)""Leda (Female)""Orus (Male)""Aoede (Female)""Callirrhoe (Female)""Autonoe (Female)"+20 morevoice_languageoptionalstringSpeech language for voice_script. Set it to match the script.
"English (US)""English (US)""English (UK)""Spanish""French""German""Italian""Portuguese (Brazil)""Japanese""Korean""Hindi"voice_promptoptionalstringDelivery instructions for the TTS voice: tone, pacing, accent, emotion. Not spoken.
"Say the following."voice_scriptoptionalstringExact words to speak when no audio is uploaded. Either audio or voice_script is required.
"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
POST /v2/p-video-2-pro-avatarSubmit — 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