Pruna AI
P-Video 2 Pro Replace
p-video-2-pro-replace
Pruna AI's character replacement video model: place people into an existing video using one or two reference images, replacing up to two people at once while preserving the original camera movement, composition, background, and motion, with the option to keep the source audio track — ideal for ad variants and localized talking-head videos
Try p-video-2-pro-replace
Input
Showcases
View all showcasesOutput
videoPricing
p-video-2-pro-replace per second
| Specifications | Unit Price |
|---|---|
| 480P | $0.0358 |
| 768P | $0.0715 |
| 1080P | $0.0858 |
| 2K | $0.100 |
| 4K | $0.1286 |
Positioning Overview
This is a video replacement tool for post-production and marketing asset creation: upload a source video and one or two reference images of people, and the people in the images can be placed into the scene of the original video while preserving the original camera movement, composition, background, and action rhythm. A prompt can specify how the people are placed, or it can be left blank to present them naturally according to the source video. It is suitable for ad variants, localized on-camera versions, and recasting characters in existing footage, and it outputs a video file that can be delivered at the source aspect ratio.
Core Highlights
- Replace people while keeping the original scene — After replacement, the source video's camera movement, composition, background, and action rhythm are retained, reducing the work of reshooting and re-staging.
- Define people with one or two reference images — Supports a single person, or two people each using one image for simultaneous replacement, which is suitable for quickly creating variants of two-person footage.
- Inherit source duration and aspect ratio — The output duration follows the source video, and the aspect ratio remains the source video's ratio, making it easy to reuse existing edits and delivery specifications.
Capability Description
Replace people with reference images: Provide one or two HTTPS images of people to place the people in the images into the source video scene; two images correspond to two on-camera people respectively, suitable for two-person shots.
Prompt controls placement: An optional prompt of up to 1000 characters is used to explain how the people should be placed into the scene; if left blank, they are handled according to the source video's original presentation.
Source video specification constraints: The source video must be an MP4, MOV, or WebM at an HTTPS address, with a duration of 2 to 30 seconds; values outside this range will be rejected. The output duration follows the source video.
Resolution selection: Choose one output specification from 480p, 768p, 1080p, 2k, or 4k; the default is 768p, and the aspect ratio follows the source video.
Reproducible random seed: Set a random seed from 0 to 2147483647 to repeatedly generate with the same assets and parameters and compare different people-placement effects.
Applicable Scenarios
- Ad teams batch-producing on-camera variants — Use the same source video with different people reference images to produce multiple people-version video assets for placement testing and multi-platform distribution.
- Localized marketing replacement of on-camera people — Keep the original scene and rhythm while replacing the on-camera person with an image suited to the target market, obtaining a localized version that can be directly substituted into existing edits.
- Recasting characters in existing footage — Change the on-camera person in already-shot footage without re-staging or reshooting, outputting a video file suitable for continued editing and delivery.
- Simultaneous replacement in two-person shots — Provide one reference image for each of two people and generate a two-person on-camera version in one pass, for producing multi-person assets for social short videos.
Limitations and Selection Advice
At most two people can be replaced at a time, and the source video must be 2 to 30 seconds; shorter or longer videos will be rejected, and the output duration follows the source video. Both a source video and at least one reference image must be provided; video cannot be generated from text alone. When keeping the source audio is disabled, the original audio track is not retained, so you must confirm the final version's sound yourself. Replacement results are affected by the reference images and the source video's visual conditions, and complete consistency of the people's appearance is not guaranteed.
What's new
View changelog →- New model P-Video 2 Pro Replace is live: swap the people in a video with 1–2 photos
Frequently asked questions
View all FAQs →-
How many people in the image can be replaced at most?
Up to two people. Put 1–2 photos of people in image_urls: one photo for one person, and one photo per person when there are two. You can use prompt to add instructions on how to place the people into the scene.
-
How long can the source video be?
Currently only source videos of 2 to 30 seconds are accepted; requests outside this range will be rejected. The output duration matches the source video and cannot be specified separately; if your material is longer, you need to trim it yourself or split it into segments and process them separately.
-
Will the camera and background change during replacement?
No. Camera movement, composition, background, and timing all follow the source video; the model only replaces the person. It also cannot change the shooting style through parameters; if you want a different camera angle or scene, you need to use a different source video.
-
Can the original video's sound be preserved?
Yes, it is preserved by default: keep_audio defaults to true, and the output carries the source video's audio track. When set to false, the output has no original audio.
Create a generation task
https://api.hiapi.ai/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: p-video-2-pro-replace
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for p-video-2-pro-replace and route default — see the parameter table below.
seedintegerOptionalmin 0max 2147483647Random seed, an integer from 0 to 2147483647; passing the same seed while keeping other inputs unchanged helps reproduce the result. If not passed, it is random.
promptstringOptionalmaxLength 1000Optional instruction describing how to place the person from the reference image into the scene; if left empty, the content and composition of the source video are followed directly.
video_urlstringRequiredpattern ^https://HTTPS URL of the source video, supporting MP4, MOV, and WebM formats; duration must be 2-30 seconds and must provide motion, scene, camera, and audio; requests outside this duration range will be rejected, and the output duration matches the source video.
image_urlsarrayRequiredminItems 1maxItems 2Array of HTTPS URLs of person identity images to place into the video, supporting jpg, jpeg, png, and webp; pass 1-2, which can correspond to one person, or two people with one image each.
Array [ string ]
keep_audiobooleanOptionalDefault: trueWhether to retain the audio of the source video in the output; boolean, default true.
resolutionstringOptionalDefault: "768p"Output resolution, options are 480p, 768p, 1080p, 2k, 4k, default 768p, maintaining the aspect ratio of the source video; higher resolution costs more.
480p768p1080p2k4kcallbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "p-video-2-pro-replace",
"input": {
"video_url": "…",
"image_urls": "…",
"keep_audio": true,
"resolution": "768p"
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "p-video-2-pro-replace",
input: {
"video_url": "…",
"image_urls": "…",
"keep_audio": true,
"resolution": "768p"
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "p-video-2-pro-replace",
"input": {
"video_url": "…",
"image_urls": "…",
"keep_audio": True,
"resolution": "768p"
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.ai/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →Related Models
View all models →Same Type
-
Veo 3.1 Google $0.290 /second -
Ray 3.2 Luma $0.214 /video -
Grok Imagine 1.5 Lite xAI $0.029 /second -
HeyGen Avatar IV HeyGen $0.150 /second -
Vidu Q3 Vidu $0.149 /second -
Kling 3.0 Kuaishou $0.100 /second -
PixVerse V6 Max PixVerse $0.030 /second -
Gemini Omni 1.2 Google $0.023 /second -
Kling 4.0 Flash Kuaishou $0.122 /second -
Veo 3.1 Lite Google $0.060 /second -
Grok Imagine 1.5 xAI $0.011 /second -
Gemini Omni 1.1 Google $0.450 /video
