## Basic model info

Model name: prunaai/p-video-edit
Model description: Edit videos with a text prompt and optional reference images.


## Model inputs

- video (required): Input video to edit. Maximum length: 15 seconds. (string)
- prompt (required): Text prompt describing the edit. (string)
- images (optional):  (array)
- prompt_upsampling (optional): Use prompt upsampling to enhance the edit prompt. (boolean)
- draft (optional):  (boolean)
- save_audio (optional): Save the video with audio. (boolean)
- seed (optional): Random seed. Set for reproducible generation. (integer)
- enable_safety_filter (optional):  (boolean)


## Model output schema

{
  "type": "string",
  "title": "Output",
  "format": "uri"
}

If the input or output schema includes a format of URI, it is referring to a file.


## Example inputs and outputs

Use these example outputs to better understand the types of inputs the model accepts, and the types of outputs the model returns:

### Example (https://replicate.com/p/0af5h1nvm5rmt0d0cfn8rt55a8)

#### Input

```json
{
  "draft": false,
  "video": "https://replicate.delivery/pbxt/PjaSKFnH9PE14D2W3uPk7dmG8bR7a3PUTeOlynmFKZXrQm89/replicate-prediction-nakntf2wtsrmy0d0cdvrgdnvg4.mp4",
  "images": [],
  "prompt": "Add people sit at the tables.",
  "save_audio": true,
  "prompt_upsampling": true
}
```

#### Output

```json
"https://replicate.delivery/xezq/yDLfW28AuKTvACff8OH9vc2KmquLz6wTx467Rcgp5BEMEITuA/tmp87_qd47g.mp4"
```


### Example (https://replicate.com/p/vhc012xmtnrmw0d0cfwa24v29r)

#### Input

```json
{
  "draft": false,
  "video": "https://replicate.delivery/pbxt/Pjal6iMZuNm4yLOy2y1d47GGlRFLD2pBN65WN0OHQ4M8HmhL/replicate-prediction-pzhxaxakthrmy0d0ce4v4epq6m.mp4",
  "images": [],
  "prompt": "Add color mainly to the old man in the center. Keep unsaturated the rest of the setting.",
  "save_audio": true,
  "prompt_upsampling": true
}
```

#### Output

```json
"https://replicate.delivery/xezq/HFF75U3YOGp2IRCP0QrfUGAc2ISNKEUskEZnwspk5teWPkJXA/tmp747y8w2v.mp4"
```


### Example (https://replicate.com/p/2frvrjkjr5rmw0d0cxw8y0c5zm)

#### Input

```json
{
  "draft": false,
  "video": "https://replicate.delivery/pbxt/Pjap03gEStCw2jQrHrIXaKsUdTwul2FwZ6pjAbjxcOYpphw8/replicate-prediction-kzy9fxcghdrmr0d021n9a9zs68.mp4",
  "images": [
    "https://replicate.delivery/pbxt/PjaozqvNb7sPTmkbHcnE0VhkcU8drF7a4zHbzaXTUgwJoLzT/replicate-prediction-yfs94y2c19rmw0czym3sbyrx54.jpeg"
  ],
  "prompt": "Change only the SUV body paint to yellow. Add the roof cargo box shown in the reference image to the SUV. Preserve the vehicle geometry, glass, trim, headlights, tires, reflections and shadows. Keep the environment, lighting and camera movement unchanged.",
  "save_audio": true,
  "prompt_upsampling": true
}
```

#### Output

```json
"https://replicate.delivery/xezq/5hAWCfHRAb1hWye7rVfKjJ61S1EBdTV9tcEeeGxwJx7ukUO5C/tmp6nhscf3v.mp4"
```


### Example (https://replicate.com/p/ewvcrp5sksrmt0d0cy189fbkd4)

#### Input

```json
{
  "draft": false,
  "video": "https://replicate.delivery/pbxt/PjpspRRTi4Z288Cm3qqQvuC793ql3VHw4zeLUSaMT4D7nl1j/replicate-prediction-1ef212ckt9rmt0d0cwx94r2a4w.mp4",
  "images": [],
  "prompt": "Change the material of the sofa to light purple leather. Do not change anything else.",
  "save_audio": true,
  "prompt_upsampling": true
}
```

#### Output

```json
"https://replicate.delivery/xezq/CSbG8dfGBZ2SMiZavix4M5olSxbqQ8cfzXuMqKn9ZGL8vyJXA/tmpnun73w_a.mp4"
```


### Example (https://replicate.com/p/8sbezrw675rmr0d0cy3abvtn50)

#### Input

```json
{
  "draft": false,
  "video": "https://replicate.delivery/pbxt/Pjpwkyba6N7A4umlJIL28wufD4Qw8kqTwfLOkumMYXKGD4b4/replicate-prediction-kg7cyrwkndrmt0d0cwprxy3y34.mp4",
  "images": [
    "https://replicate.delivery/pbxt/PjpwlCCt2A6q4mr7FQyw1FNQCGf2s9xXNQO2KO3s8iXVyiPM/ig_0d3024fffdd6f918016a316d879d548191a53e1454a8ae7077.png"
  ],
  "prompt": "Change the  sweater by the shirt shown in the reference.",
  "save_audio": true,
  "prompt_upsampling": true
}
```

#### Output

```json
"https://replicate.delivery/xezq/rxcU7hdqqPpFHhurWj3m4OraMQy5EmUleXcIjBIHyyHtZ5kLA/tmp_8dor_p_.mp4"
```


## Model readme

> # p-video-edit
> 
> Edit an existing video with a text instruction while preserving its motion, camera movement, performance, and timing.
> 
> P-Video-Edit is Pruna’s instruction-based video-to-video editing model. Give a source video of up to 15 seconds and describe what you want to change. You can also provide up to four reference images for product, accessory, identity, or style matching.
> 
> ## How it works
> 
> The model takes:
> 
> - A source video up to 15 seconds long.
> - A prompt describing the change you want to make.
> - Optionally, up to four reference images for the object, product, accessory, or look you want to match.
> 
> It returns an edited video with the same duration as the source. Source audio is preserved by default.
> 
> ## Tips
> 
> - Make one principal change per run. Combining unrelated edits into a single prompt can make the results less reliable.
> - Describe the final result, then explicitly name everything that must stay unchanged.
> - For tighter control, add preservation instructions: `Preserve the vehicle geometry, glass, trim, reflections, lighting, and camera movement.`
> - Use `images` when the edit must match a specific product, accessory, identity, or look. Mention the reference directly in the prompt, for example: `Replace the roof box with the product shown in the reference image.`
> - Turn on `draft` for faster, lower-cost previews. Once the prompt works, rerun it with `draft` set to `false` for the final result.
> 
> ## Example
> 
> ```python
> import replicate
> 
> output = replicate.run(
>     "prunaai/p-video-edit",
>     input={
>         "video": "https://example.com/source-video.mp4",
>         "prompt": (
>             "Change only the SUV body paint to deep metallic red. "
>             "Preserve the vehicle geometry, glass, trim, headlights, "
>             "tires, reflections, and shadows. Keep the environment, "
>             "lighting, timing, and camera movement unchanged."
>         ),
>         "draft": False,
>         "prompt_upsampling": True,
>         "save_audio": True,
>         "seed": 42,
>     },
> )
> 
> print(output)
> ```
> 
> ## Pricing
> 
> Pricing is per second of the returned video:
> 
> - Full quality (`draft=false`): $0.045 per second
> - Draft (`draft=true`): $0.025 per second
> 
> For example, a 10-second output costs $0.45 at full quality or $0.25 in draft mode. Draft mode is a faster, cheaper option for iterating before you switch to full quality.

