Pruna AI P Video 2 Pro Reference To Video API Documentation
Playground
Try it on WaveSpeedAI!Pruna P-Video-2-Pro Reference-to-Video generates reference-guided videos from image, video, and audio inputs, supporting flexible multimodal guidance for consistent subjects, motion, visual style, and creative video production workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
P-Video-2 Pro Reference-to-Video generates videos from a text prompt with multimodal reference guidance. Combine reference images, video clips, optional audio, and opening or ending keyframes to control subjects, appearance, motion, scene direction, and the start or end of the generated sequence.
Why Choose This?
-
Multimodal reference guidance
Combine images, videos, and optional audio references in the same generation workflow. -
Opening and ending keyframes
Usestart_imageorend_imageto guide how the generated video begins or ends. -
Multiple visual references
Use up to9images in total, including first- and last-frame images. -
Video reference support
Add up to3reference videos for motion, appearance, or scene guidance. -
Optional audio references
Add up to3audio references for additional sound or performance guidance. -
Speed and cost modes
Choosespeedfor faster generation orcostwhen lower generation price is preferred. -
480p and 768p output
Select the resolution that fits your quality and cost requirements.
Parameters
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Text description of the desired video, including scene, action, camera movement, and how supplied references should be used. |
| images | Conditional | Reference image URLs. Up to 9 images are supported in total when combined with start_image and end_image. |
| videos | Conditional | Up to 3 reference video URLs. Combined reference-video duration supports up to 15 seconds. |
| audios | No | Optional reference audio URLs. Supports up to 3 inputs with a combined duration of up to 15 seconds. Audio cannot be used as the only reference type. |
| keep_audio | No | Keep the supplied audio as the output soundtrack instead of using it only as a reference. Default: false. Requires exactly one file in audios when enabled. |
| start_image | No | Optional opening keyframe image URL. Counts toward the 9-image total limit. |
| end_image | No | Optional ending keyframe image URL. Counts toward the 9-image total limit. |
| duration | No | Requested output duration in seconds. Range: 5–15. Default: 5. |
| resolution | No | Output resolution: 480p or 768p. Default: 768p. |
| mode | No | Generation mode: speed or cost. Default: speed. |
| aspect_ratio | No | Optional output aspect ratio: 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, or 1:1. Leave empty to automatically adapt to the input references. |
| prompt_upsampler | No | Prompt enhancement mode: off, turbo, or max. Default: off. |
| seed | No | Optional random seed for generation. |
prompt is required.
At least one of the following visual reference inputs must also be provided:
imagesvideosstart_imageend_image
audios can provide reference guidance or, with keep_audio=true, the output soundtrack. Audio cannot be used as the only reference input.
How to Use
- Add visual references — Provide at least one image, video, first-frame image, or last-frame image.
- Add audio optional — Supply reference audio for sound or performance guidance. To keep an audio file as the soundtrack, provide exactly one file and enable
keep_audio. - Write the prompt — Describe the desired scene, motion, camera behavior, and the role of each reference.
- Choose duration — Select an output length from
5to15seconds. - Choose resolution — Select
480por768p. - Choose generation mode — Use
speedfor faster generation orcostfor lower-priced generation. - Choose aspect ratio — Leave empty to automatically adapt to the input references, or select a supported layout.
- Configure prompt enhancement optional — Select
off,turbo, ormax. - Set seed optional — Use a fixed seed when reproducibility is needed.
- Submit — Generate and retrieve the completed video.
Pricing
Pricing includes the requested output duration plus any submitted image, video, and audio references.
Output Video
| Resolution | Speed Mode | Cost Mode |
|---|---|---|
| 480p | $0.020 / second | $0.015 / second |
| 768p | $0.035 / second | $0.025 / second |
Reference Images
images, start_image, and end_image use the same per-image rate.
| Mode | Price per Image |
|---|---|
| Speed | $0.010 |
| Cost | $0.005 |
Reference Videos
| Resolution | Speed Mode | Cost Mode |
|---|---|---|
| 480p | $0.040 / billed second | $0.030 / billed second |
| 768p | $0.060 / billed second | $0.060 / billed second |
Reference-video billing duration is rounded up to the next whole second and capped at 15 seconds in total. The billable duration may also be limited based on the requested output duration and number of reference videos.
Reference Audio
| Mode | Price per Billed Second |
|---|---|
| Speed | $0.0025 |
| Cost | $0.0015 |
Combined reference-audio billing duration is rounded up to the next whole second and capped at 15 seconds.
Example
A 5-second 480p output with one reference image costs:
| Mode | Calculation | Cost |
|---|---|---|
| Speed | 5 × $0.020 + 1 × $0.010 | $0.110 |
| Cost | 5 × $0.015 + 1 × $0.005 | $0.080 |
aspect_ratio, prompt_upsampler, keep_audio, and seed do not add separate charges. Supplied audio is still billed at the audio rate above.
Best Use Cases
- Character-driven video — Use reference images to guide subject appearance and identity.
- Product and brand videos — Combine product images with scene and motion instructions.
- Motion-guided generation — Use reference videos to guide movement, pacing, or camera behavior.
- Start-and-end-frame workflows — Control the opening or ending state with dedicated keyframes.
- Multi-reference scenes — Combine several visual references into one generated sequence.
- Audio-guided generation — Add reference audio alongside visual references for additional guidance.
- Creative prototyping — Compare different references, modes, resolutions, and prompt directions.
Pro Tips
- Give each reference a clear role in the prompt instead of relying on the model to infer how it should be used.
- Use visually consistent references when character or product continuity matters.
- Use
start_imagewhen the opening composition must be controlled. - Use
end_imagewhen the final pose, framing, or scene state matters. - Avoid conflicting instructions between the prompt and supplied keyframes.
- Use
480pfor lower-cost testing before generating at768p. - Use
costmode when minimizing generation cost is more important than using the speed-oriented mode. - Keep reference videos focused on the motion or visual behavior you want to transfer.
Notes
promptis required.- Audio alone cannot satisfy the reference requirement.
- At least one image, video, first-frame image, or last-frame image must be provided.
images,start_image, andend_imageshare a combined maximum of9images.- Up to
3reference videos are supported. - Up to
3reference audio inputs are supported whenkeep_audiois off (the default). Enablekeep_audiowith exactly one audio file to use it as the output soundtrack. - With
keep_audio=true, shorter audio plays first and generated audio fills the remainder; longer audio is trimmed. If its duration is within one second ofduration, the video length follows the audio. - Reference-video and reference-audio duration are each limited to a combined maximum of
15seconds. - Output duration supports
5–15seconds and defaults to5. resolutiondefaults to768p.modedefaults tospeed.- Leave
aspect_ratioempty to automatically adapt to the input references. prompt_upsamplerdefaults tooff.- The returned video duration may differ slightly from the requested duration.
Related Models
- P-Video-2 Pro Text-to-Video — Generate videos directly from text prompts.
- P-Video-2 Pro Image-to-Video — Generate videos from a first-frame image and text prompt.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"duration": 5,
"resolution": "768p",
"mode": "speed",
"aspect_ratio": "16:9",
"prompt_upsampler": "off",
"keep_audio": false
}
JSON
)
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/pruna-ai/p-video-2-pro/reference-to-video" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}")
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}")
RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| prompt | string | Yes | 1 ~ unlimited characters | Describe the video using the uploaded references. | |
| images | array<string> | No | - | 0 ~ 9 items | Optional reference images. Up to 9 images including first and last frames. |
| videos | array<string> | No | - | 0 ~ 3 items | Optional reference videos. Up to 3 clips, 15 seconds combined. |
| audios | array<string> | No | - | 0 ~ 3 items | Optional reference audio clips. Up to 3 clips, 15 seconds combined. |
| start_image | string | No | - | - | Optional opening keyframe image. |
| end_image | string | No | - | - | Optional ending keyframe image. |
| duration | integer | No | 5 | 5 ~ 15 | Requested output duration in seconds. |
| resolution | string | No | 768p | 480p, 768p | - |
| mode | string | No | speed | speed, cost | - |
| aspect_ratio | string | No | - | 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 1:1 | Optional output aspect ratio. Leave empty to automatically adapt to the input references. |
| prompt_upsampler | string | No | off | off, turbo, max | - |
| keep_audio | boolean | No | false | - | Use the supplied audio as the soundtrack. Requires exactly one audio file. |
| seed | integer | No | - | - | - |
Conditional constraints
- When
keep_audioistrue:audiosis required;audiosmust have exactly 1 item.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Task status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses. |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Status: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |