---
title: "p-video-edit"
description: "Edit a source video with a text prompt and optional reference images"
url: "https://docs.api.pruna.ai/guides/models/p-video-edit"
image: "https://docs.api.pruna.ai/_og/d/c_Ocean.takumi,title_p-video-edit,description_Edit+a+source+video+with+a+text+prompt+and+optional+reference+images,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiM3YzNhZWQifX19,p_Ii9ndWlkZXMvbW9kZWxzL3AtdmlkZW8tZWRpdCI,s_o6rfHu0OS0itclsF.png"
---

# p-video-edit

Edit an existing video from a text prompt, optionally guided by reference images

## [Overview](#overview)

p-video-edit takes a source video and a text prompt, then returns an edited video. Optional reference images guide identity or style. Input video maximum length is 15 seconds.

**Rate Limit:** 50 requests per minute

**Category:** Video Editing

**Pricing:** billed per second of the **returned** video ($0.045 standard, $0.025 draft).

| Configuration          | Price                             |
| :--------------------- | :-------------------------------- |
| standard (draft=false) | 0.045$ per second of output video |
| draft (draft=true)     | 0.025$ per second of output video |

## [Quickstart](#quickstart)

### [Upload your source video](#upload-your-source-video)

```bash
curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/source-video.mp4"
```

### [Create an edited video](#create-an-edited-video)

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-video-edit' \
  -d '{
    "input": {
      "video": "https://api.pruna.ai/v1/files/source-video-abc123",
      "prompt": "Replace the sky with a sunset"
    }
  }'
```

### [Synchronous request](#synchronous-request)

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-video-edit' \
  -H 'Try-Sync: true' \
  -d '{
    "input": {
      "video": "https://api.pruna.ai/v1/files/source-video-abc123",
      "prompt": "Replace the sky with a sunset",
      "draft": true
    }
  }'
```

### [Optional reference images](#optional-reference-images)

```bash
curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/reference-image.png"
```

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-video-edit' \
  -d '{
    "input": {
      "video": "https://api.pruna.ai/v1/files/source-video-abc123",
      "prompt": "Replace the person with the reference",
      "images": [
        "https://api.pruna.ai/v1/files/reference-image-def456"
      ]
    }
  }'
```

## [Parameters](#parameters)

### [Required Parameters](#required-parameters)

| Parameter | Type         | Description                                     |
| :-------- | :----------- | :---------------------------------------------- |
| video     | string (URI) | Input video to edit. Maximum length: 15 seconds |
| prompt    | string       | Text prompt describing the edit                 |

### [Optional Parameters](#optional-parameters)

| Parameter         | Type            | Default | Description                                                                      |
| :---------------- | :-------------- | :------ | :------------------------------------------------------------------------------- |
| images            | arraystring URI |         | Optional reference image(s) for reference-guided editing. Up to 4 images. Supports jpg, jpeg, png, webp |
| prompt_upsampling | boolean         | true    | Use prompt upsampling to enhance the edit prompt                                 |
| draft             | boolean         | false   | Draft mode. Faster, lower-quality preview. Billed at $0.025 per second           |
| save_audio        | boolean         | true    | Save the video with audio                                                        |
| seed              | integer         | random  | Random seed. Set for reproducible generation                                     |