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

# Wan2.7 I2V

> Create videos from a first frame, first and last frames, or an initial clip using Wan2.7 I2V.

Wan2.7 I2V is Alibaba Cloud's image-to-video model, available through the AnyFast asynchronous video API. It supports first-frame animation, first-and-last-frame control, video continuation, and optional audio-driven motion.

`I2V` means **image-to-video**. Wan2.7 also accepts an initial video clip for continuation.

## Supported media combinations

| Workflow                                | `input.media` types                            |
| --------------------------------------- | ---------------------------------------------- |
| First-frame animation                   | `first_frame`                                  |
| First-frame animation with audio        | `first_frame` + `driving_audio`                |
| First-and-last-frame control            | `first_frame` + `last_frame`                   |
| First-and-last-frame control with audio | `first_frame` + `last_frame` + `driving_audio` |
| Video continuation                      | `first_clip`                                   |
| Video continuation with an ending frame | `first_clip` + `last_frame`                    |

Each media type can appear at most once. Output aspect ratio follows the first frame or first video clip.

## Enable NSFW generation

1. Select the `Special-Ns` resource group when creating the API token.
2. Set `parameters.prompt_extend` to `false`. Its default value is `true`.

## Quick example

```bash cURL theme={null}
curl https://www.anyfast.ai/v1/video/generations \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "wan2.7-i2v",
    "input": {
      "prompt": "The camera slowly moves closer as the lanterns begin to glow.",
      "media": [
        {
          "type": "first_frame",
          "url": "https://example.com/first-frame.png"
        }
      ]
    },
    "parameters": {
      "resolution": "720P",
      "duration": 5,
      "prompt_extend": true,
      "watermark": false
    }
  }'
```

## Input limits

* Images: JPEG/JPG/PNG/BMP/WEBP, 240-8,000 px per side, aspect ratio 1:8 to 8:1, up to 20 MB; public URL or Base64 data URL
* Driving audio: WAV/MP3, 2-30 seconds, up to 15 MB; public URL
* Initial clip: MP4/MOV, 2-10 seconds, 240-4,096 px per side, aspect ratio 1:8 to 8:1, up to 100 MB; public URL

For continuation, `parameters.duration` is the maximum total output duration, including the input clip.

## Parameters

| Parameter                  | Type    | Required | Description                                                   |
| -------------------------- | ------- | -------- | ------------------------------------------------------------- |
| `model`                    | string  | Yes      | Must be `wan2.7-i2v`                                          |
| `input.prompt`             | string  | No       | Motion and scene description, up to 5,000 characters          |
| `input.negative_prompt`    | string  | No       | Content to exclude, up to 500 characters                      |
| `input.media`              | array   | Yes      | One of the supported media combinations above                 |
| `input.media[].type`       | string  | Yes      | `first_frame`, `last_frame`, `driving_audio`, or `first_clip` |
| `input.media[].url`        | string  | Yes      | Public media URL; images also support Base64 data URLs        |
| `parameters.resolution`    | string  | No       | `720P` or `1080P`. Default: `1080P`                           |
| `parameters.duration`      | integer | No       | Total duration from 2 to 15 seconds. Default: `5`             |
| `parameters.prompt_extend` | boolean | No       | Rewrite and enrich the prompt. Default: `true`                |
| `parameters.watermark`     | boolean | No       | Add an "AI Generated" watermark. Default: `false`             |
| `parameters.seed`          | integer | No       | Random seed in `[0, 2147483647]`                              |

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/model-api/alibaba/wan2.7-i2v">View the complete request schema.</Card>
  <Card title="Task Query" icon="magnifying-glass" href="/guides/model-api/alibaba/wan2-task-query">Poll the task and retrieve the result URL.</Card>
</CardGroup>

## Official reference

See the [Alibaba Cloud Model Studio Wan2.7 image-to-video API reference](https://www.alibabacloud.com/help/en/model-studio/image-to-video-general-api-reference).

<script src="/feedback.js" />
