Pruna P Video Avatar Serverless API
Animate any portrait into a lip-synced talking avatar.
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) 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
https://api.segmind.com/v1/p-video-avatarParameters
imagerequiredstring (uri)First-frame portrait in jpg, jpeg, png or webp. Use clean, front-facing headshots.
audiooptionalstring (uri)Audio URL to lip-sync; overrides voice_script. Upload clean, music-free voice recordings.
disable_prompt_upsamplingoptionalbooleanSkips prompt enhancement when true. Enable for exact, literal prompt wording.
falsedisable_safety_filteroptionalbooleanToggles safety checks on prompts and image. Leave default unless needed.
truenegative_promptoptionalstringLists what to avoid in the video. Try subtitles, blurry, watermark.
""resolutionoptionalstringOutput resolution, 720p or 1080p. Use 720p to iterate, 1080p for finals.
"720p""720p""1080p"seedoptionalintegerRandom seed for reproducibility. Reuse a seed to repeat a result.
nullRange: -1 - 999999999999999strength_negative_promptoptionalnumberNegative-prompt intensity from 0 to 4. Start near 0.5 and adjust.
0.5Range: 0 - 4video_promptoptionalstringDescribes framing, motion and background. Keep simple; fixed camera aids lip-sync.
"The person is talking."voiceoptionalstringOne of 30 built-in TTS voices, used with voice_script. Match speaker gender.
"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, ten options. Set it to match your script.
"English (US)""English (US)""English (UK)""Spanish""French""German""Italian""Portuguese (Brazil)""Japanese""Korean""Hindi"voice_promptoptionalstringSets tone, pace and emotion, not the words. Try warm, confident, energetic.
"Say the following."voice_scriptoptionalstringText the avatar speaks when no audio is supplied. Keep sentences short.
"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-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