Pruna P Video 2 Pro Reference API

Keep characters and products consistent in reference-to-video, with audio.

PlaygroundAPI
Pricing
~23.50s
POST /v2/p-video-2-pro-reference · 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    "prompt": "The cellist from the reference image draws his bow across the strings, swaying into the phrase with his eyes closed, then opens them to the camera. Sound: a resonant cello and the faint creak of the chair.",
11    "image": ["https://segmind-resources.s3.amazonaws.com/input/p-video-2-pro-reference-cellist-ref.jpg"],
12    "resolution": "768p",
13    "mode": "speed",
14    "duration": 5,
15    "aspect_ratio": "16:9",
16    "prompt_upsampler": "turbo",
17    "seed": -1,
18}
19job = client.submit_async("p-video-2-pro-reference", **payload)
20print(job.request_id)                         # available immediately
21try:
22    result = job.wait(timeout=900, interval=2.0)
23    print(result["status"])                  # COMPLETED
24    print(result.get("output"))              # model output (e.g. video URL)
25except InferenceTimeout as e:
26    print("still running:", e.request_id)    # re-poll later with this id
27except InferenceFailed as e:
28    print("failed:", e.detail)
29
30# Fast models (<=600s) can use the one-liner instead:
31# result = segmind.run("p-video-2-pro-reference", **payload)

API Endpoint

POSThttps://api.segmind.com/v1/p-video-2-pro-reference

Parameters

promptrequired
string

Describe the scene, action and camera, and name what each reference should contribute; audio is generated, so write ambience, effects and dialogue into the prompt.

aspect_ratiooptional
string

Output frame shape: adaptive, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 or 1:1 (default 16:9). Use adaptive to let the references set the shape, 9:16 for social.

Default: "16:9"
Allowed values :
Adaptive→"adaptive"
"16:9""9:16""4:3""3:4""3:2""2:3""1:1"
audiooptional
string[]

Up to 3 reference audio files (15 s combined, 50 MiB each) to drive dialogue, music or pacing. Audio alone is not enough — send at least one image or video reference too.

durationoptional
integer

Target length in whole seconds, 5 to 15 (default 5); the clip returned may run slightly shorter or longer and billing follows it. Use 5 to 6 s for tests.

Default: 5Range: 5 - 15
first_frame_imageoptional
string (uri)

Soft keyframe for a frame-exact opening (20 MiB, 4096 px; counts toward the 9 reference images). Set it when the clip must start on a specific still; it forces the turbo prompt upsampler.

imageoptional
string[]

Up to 9 reference images (20 MiB, 4096 px each; first and last frames count toward the 9) for characters, products, locations or style. Soft guidance — the prompt decides the shot; use first_frame_image for a frame-exact start.

last_frame_imageoptional
string (uri)

Soft keyframe for a frame-exact ending (20 MiB, 4096 px; counts toward the 9 reference images). Pair with first_frame_image to lock both ends of a transition; it forces the turbo prompt upsampler.

modeoptional
string

Generation recipe, speed (default) or cost; there is no quality mode. Use speed for the fastest pass, cost for a lower per-second rate.

Default: "speed"
Allowed values :
Speed→"speed"
Cost→"cost"
prompt_upsampleroptional
string

How far a short prompt is expanded before generating: off, turbo (default) or max; independent of mode and price. A first or last frame image forces turbo.

Default: "turbo"
Allowed values :
Off→"off"
Turbo→"turbo"
Max→"max"
resolutionoptional
string

Output resolution, 480p or 768p (default 768p). Use 768p for the quality tier; 480p to lower the per-second rate on high-volume runs.

Default: "768p"
Allowed values :
"480p""768p"
seedoptional
integer

Fixed seed from -1 to 2147483647 (default -1 for a new result each run). Set a fixed value to reproduce an output.

Default: -1Range: -1 - 2147483647
videooptional
string[]

Up to 3 reference clips (2 to 15 s each, 15 s combined, up to 1080p 60 fps, 100 MiB each) for motion, framing or style. Use one to carry a camera move or action into a new scene.

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-2-pro-reference

    Submit — returns request_id, status_url, response_url

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

    Poll — until COMPLETED or FAILED

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

    Result — final response body

Status states

QUEUED— Accepted, waiting for a worker
PROCESSING— Running on a worker
COMPLETED— Done — result body is ready
FAILED— Errored (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