Pruna P Video Animate Serverless API
Transfer video motion and audio onto any still image.
POST /v2/p-video-animate · 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 "video": "https://segmind-resources.s3.amazonaws.com/input/pva-driving-video-14997.mp4",
11 "image": "https://segmind-resources.s3.amazonaws.com/input/pva-image-subject-14997.jpg",
12 "resolution": "720p",
13 "turbo": False,
14 "save_audio": True,
15 "ignore_audio": False,
16 "target_fps": "original",
17 "instruction_prompt": "",
18 "seed": 42,
19 "disable_safety_checker": False,
20}
21job = client.submit_async("p-video-animate", **payload)
22print(job.request_id) # available immediately
23try:
24 result = job.wait(timeout=900, interval=2.0)
25 print(result["status"]) # COMPLETED
26 print(result.get("output")) # model output (e.g. video URL)
27except InferenceTimeout as e:
28 print("still running:", e.request_id) # re-poll later with this id
29except InferenceFailed as e:
30 print("failed:", e.detail)
31
32# Fast models (<=600s) can use the one-liner instead:
33# result = segmind.run("p-video-animate", **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 "video": "https://segmind-resources.s3.amazonaws.com/input/pva-driving-video-14997.mp4",
11 "image": "https://segmind-resources.s3.amazonaws.com/input/pva-image-subject-14997.jpg",
12 "resolution": "720p",
13 "turbo": False,
14 "save_audio": True,
15 "ignore_audio": False,
16 "target_fps": "original",
17 "instruction_prompt": "",
18 "seed": 42,
19 "disable_safety_checker": False,
20}
21job = client.submit_async("p-video-animate", **payload)
22print(job.request_id) # available immediately
23try:
24 result = job.wait(timeout=900, interval=2.0)
25 print(result["status"]) # COMPLETED
26 print(result.get("output")) # model output (e.g. video URL)
27except InferenceTimeout as e:
28 print("still running:", e.request_id) # re-poll later with this id
29except InferenceFailed as e:
30 print("failed:", e.detail)
31
32# Fast models (<=600s) can use the one-liner instead:
33# result = segmind.run("p-video-animate", **payload)API Endpoint
https://api.segmind.com/v1/p-video-animateParameters
imagerequiredstring (uri)Reference still of the subject to animate. Use front-facing, well-lit portraits.
videorequiredstring (uri)Source MP4 whose motion and audio drive animation. Use stable, clear footage.
disable_safety_checkeroptionalbooleanToggles content safety filtering. Leave disabled for standard, safe generations.
falseignore_audiooptionalbooleanIgnores source audio during generation. Enable for silent, motion-only animation.
falseinstruction_promptoptionalstringOptional text guiding how the subject animates. Name the subject and motion beats.
""resolutionoptionalstringOutput resolution, 720p or 1080p. Choose 1080p for crisp, detail-heavy results.
"720p""720p""1080p"save_audiooptionalbooleanKeeps the source audio in output. Enable for talking-head or dialogue clips.
trueseedoptionalintegerRandom seed for reproducibility. Fix a value to repeat identical results.
42Range: -1 - 999999999999999target_fpsoptionalstringOutput frame rate: original, 24, or 48. Use 48 for smoother motion.
"original""original""24""48"turbooptionalbooleanFaster inference at slightly lower quality. Enable for quick draft previews.
falseResponse 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-animateSubmit — 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