> ## 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

> 支持首帧、首帧加音频、首尾帧、首尾帧加音频、起始视频续写，以及起始视频加尾帧。每种素材类型最多出现一次。



## OpenAPI

````yaml zh/api-reference/model-api/alibaba/openapi/wan2.7-i2v/openapi.yaml POST /v1/video/generations
openapi: 3.1.0
info:
  title: Wan2.7 I2V
  description: 通过 AnyFast 异步视频 API，使用首帧、驱动音频或起始视频片段生成视频。
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/video/generations:
    post:
      summary: 创建 Wan2.7 图生视频任务
      description: 支持首帧、首帧加音频、首尾帧、首尾帧加音频、起始视频续写，以及起始视频加尾帧。每种素材类型最多出现一次。
      operationId: createWan27I2vZh
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - wan2.7-i2v
                input:
                  type: object
                  required:
                    - media
                  properties:
                    prompt:
                      type: string
                      maxLength: 5000
                      description: 动作和场景描述。
                    negative_prompt:
                      type: string
                      maxLength: 500
                    media:
                      type: array
                      minItems: 1
                      maxItems: 3
                      items:
                        $ref: '#/components/schemas/Media'
                parameters:
                  $ref: '#/components/schemas/GenerationParameters'
              example:
                model: wan2.7-i2v
                input:
                  prompt: 灯笼逐渐亮起，镜头缓慢向前推进。
                  media:
                    - type: first_frame
                      url: https://example.com/first-frame.png
                parameters:
                  resolution: 720P
                  duration: 5
                  prompt_extend: true
                  watermark: false
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreated'
        '400':
          description: 参数无效或素材组合不受支持
        '401':
          description: 未授权
        '429':
          description: 请求频率超限
components:
  schemas:
    Media:
      type: object
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - first_frame
            - last_frame
            - driving_audio
            - first_clip
        url:
          type: string
          description: 公开素材 URL；首帧和尾帧也支持 Base64 Data URL。
    GenerationParameters:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 720P
            - 1080P
          default: 1080P
        duration:
          type: integer
          minimum: 2
          maximum: 15
          default: 5
          description: 最终视频总时长；视频续写时包含输入片段。
        prompt_extend:
          type: boolean
          default: true
          description: 是否改写并扩展提示词。开启 NSFW 功能时，令牌需选择 Special-Ns 资源分组，并将本参数设置为 false。
        watermark:
          type: boolean
          default: false
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
    TaskCreated:
      type: object
      properties:
        id:
          type: string
          example: asyntask_example123
        task_id:
          type: string
          example: asyntask_example123
        object:
          type: string
          example: video
        model:
          type: string
          example: wan2.7-i2v
        status:
          type: string
          example: queued
        progress:
          type: integer
          example: 0
        created_at:
          type: integer
          example: 1784520000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````