> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magnific.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WAN 2.7 Video Edit API

> Edit existing videos with WAN 2.7 using text instructions, reference images, or style transfer. 720P and 1080P output, up to 3 reference images, and configurable audio handling.

<Card title="Alibaba WAN 2.7 integration" icon="video">
  WAN 2.7 Video Edit transforms an existing video with natural-language instructions, reference images, or artistic style transfer while preserving the source footage.
</Card>

WAN 2.7 Video Edit is an AI video editing API that transforms an existing video based on a text prompt. You provide an input video via `video_url` and describe the desired changes, optionally guiding the edit with up to 3 reference images. The model supports three editing modes: instruction-based editing, reference-image editing, and style transfer. Output is available at 720P (1280x720) or 1080P (1920x1080) resolution, and you can preserve the full input duration or cap it at up to 10 seconds.

### Editing modes

| Mode                          | Parameters                                         | Use case                                                           |
| ----------------------------- | -------------------------------------------------- | ------------------------------------------------------------------ |
| **Instruction-based editing** | `video_url` + `prompt`                             | Change scene elements with text (e.g., "change the sky to sunset") |
| **Reference-image editing**   | `video_url` + `prompt` + `image_urls`              | Apply visual references from images to the video                   |
| **Style transfer**            | `video_url` + `prompt` + `image_urls` (style refs) | Transfer artistic styles from reference images                     |

### Key capabilities

* **Instruction-based editing**: Transform video content with natural-language prompts up to 5,000 characters
* **Reference-image editing**: Guide edits with up to 3 reference images (JPEG, PNG, BMP, WEBP)
* **Style transfer**: Apply artistic styles from reference images to the source video
* **Resolution options**: 720P (1280x720) and 1080P (1920x1080) output
* **5 aspect ratios**: `16:9`, `9:16`, `1:1`, `4:3`, `3:4` (or preserve the input video's ratio)
* **Duration control**: Set `duration` to `0` to preserve the full input video, or cap output at up to 10 seconds
* **Audio handling**: `auto` to generate/adapt audio, or `origin` to preserve the original track
* **Async processing**: Webhook notifications or polling for task completion

### Use cases

* **Scene retiming and relighting**: Change time of day, weather, or lighting with a text instruction
* **Background replacement**: Swap or restyle backgrounds while keeping subjects intact
* **Brand styling**: Apply a consistent artistic look across video assets with style transfer
* **Reference-guided edits**: Match a target look supplied through reference images
* **Content repurposing**: Reframe or restyle existing footage for different channels

### Edit videos with WAN 2.7

Edit a video by submitting the input video URL and a prompt to the API. The service returns a task ID for async polling or webhook notification.

<div className="my-11">
  <Columns cols={2}>
    <Card title="POST /v1/ai/video-edit/wan-2-7" icon="video" href="/api-reference/video-edit/wan-2-7/generate">
      Create a new video edit task
    </Card>

    <Card title="GET /v1/ai/video-edit/wan-2-7" icon="list" href="/api-reference/video-edit/wan-2-7/wan-2-7-video-edit-tasks">
      List all WAN 2.7 video edit tasks with status
    </Card>

    <Card title="GET /v1/ai/video-edit/wan-2-7/{task-id}" icon="magnifying-glass" href="/api-reference/video-edit/wan-2-7/task-by-id">
      Get task status and results by ID
    </Card>
  </Columns>
</div>

### Parameters

| Parameter                           | Type      | Required | Default     | Description                                                                                            |
| ----------------------------------- | --------- | -------- | ----------- | ------------------------------------------------------------------------------------------------------ |
| `video_url`                         | `string`  | Yes      | -           | URL of the input video to edit. MP4/MOV, 2-10s, 240-4096px per side, max 100MB                         |
| `prompt`                            | `string`  | No       | -           | Editing instructions describing the desired changes. Max 5,000 characters                              |
| `negative_prompt`                   | `string`  | No       | -           | Elements to avoid (e.g., "watermark, text, distortion, blurry"). Max 500 characters                    |
| `image_urls`                        | `array`   | No       | -           | Reference images for editing or style transfer (up to 3). JPEG/PNG/BMP/WEBP, 240-8000px, max 20MB each |
| `aspect_ratio`                      | `string`  | No       | Input ratio | Output ratio: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`                                                      |
| `resolution`                        | `string`  | No       | `1080P`     | Output resolution: `720P` or `1080P`                                                                   |
| `duration`                          | `integer` | No       | `0`         | Output length in seconds (0-10). Set to `0` to preserve the full input video duration                  |
| `seed`                              | `integer` | No       | Random      | Seed for reproducibility (0 to 2147483647)                                                             |
| `additional_settings.audio_setting` | `string`  | No       | `auto`      | Audio handling: `auto` (generate/adapt) or `origin` (preserve original)                                |
| `additional_settings.prompt_extend` | `boolean` | No       | `true`      | Enable AI prompt expansion for richer edits                                                            |
| `webhook_url`                       | `string`  | No       | -           | URL for async status notifications                                                                     |

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What is WAN 2.7 Video Edit and how does it work?">
    WAN 2.7 Video Edit is an AI video editing API developed by Alibaba. You provide an input video URL and a text prompt describing the changes you want. The model applies those edits and returns a task ID immediately, then you poll for results or receive a webhook notification when processing completes.
  </Accordion>

  <Accordion title="What editing modes are supported?">
    Three modes: instruction-based editing (`prompt` only), reference-image editing (`prompt` + `image_urls`), and style transfer (`prompt` + style reference `image_urls`). All three require an input `video_url`.
  </Accordion>

  <Accordion title="What input video formats and limits apply?">
    Input videos must be MP4 or MOV at a publicly accessible URL, 2-10 seconds long, 240-4096px per side with an aspect ratio between 1:8 and 8:1, and a maximum file size of 100MB.
  </Accordion>

  <Accordion title="How do I keep the original video length?">
    Set `duration` to `0` to preserve the full duration of the input video. To cap the output, set `duration` to any value from 1 to 10 seconds.
  </Accordion>

  <Accordion title="Can I keep the original audio?">
    Yes. Set `additional_settings.audio_setting` to `origin` to preserve the input video's audio, or use `auto` (the default) to automatically generate or adapt audio for the edited video.
  </Accordion>

  <Accordion title="What are the rate limits for WAN 2.7 Video Edit?">
    Rate limits depend on your subscription tier. See the [Rate Limits](/ratelimits) page for current limits by plan.
  </Accordion>

  <Accordion title="How much does WAN 2.7 Video Edit cost?">
    See the [Pricing page](/pricing) for current rates and subscription options.
  </Accordion>
</AccordionGroup>

## Best practices

* **Clear instructions**: Describe the exact change you want ("replace the background with a snowy mountain range") for predictable edits.
* **Reference images**: Provide clean, high-resolution reference images when using reference-image editing or style transfer.
* **Duration**: Start with `duration: 0` to preserve the source, then cap the length only when needed.
* **Audio**: Use `origin` when the original audio must be retained (e.g., dialogue); use `auto` when the edit changes the scene significantly.
* **Negative prompts**: Include: "watermark, text, distortion, blurry, extra limbs"
* **Production integration**: Use webhooks for scalable applications instead of polling.
* **Error handling**: Implement retry with exponential backoff for 503 errors during high-demand periods.

## Related APIs

* **[WAN 2.7 Text-to-Video](/api-reference/text-to-video/wan-2-7/overview)**: Generate videos from text prompts
* **[WAN 2.7 Image-to-Video](/api-reference/image-to-video/wan-2-7/overview)**: Animate images or extend existing videos
* **[WAN 2.7 Reference-to-Video](/api-reference/reference-to-video/wan-2-7/overview)**: Generate videos featuring characters from reference images or videos
