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

> 至少传入一个参考图片或视频。参考图片与参考视频合计不超过 5 个，并可额外传入一个首帧。



## OpenAPI

````yaml zh/api-reference/model-api/alibaba/openapi/wan2.7-r2v/openapi.yaml POST /v1/video/generations
openapi: 3.1.0
info:
  title: Wan2.7 R2V
  description: 使用参考图片、视频、音色和可选首帧生成主体一致的视频。
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/video/generations:
    post:
      summary: 创建 Wan2.7 参考生视频任务
      description: 至少传入一个参考图片或视频。参考图片与参考视频合计不超过 5 个，并可额外传入一个首帧。
      operationId: createWan27R2vZh
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - wan2.7-r2v
                input:
                  type: object
                  required:
                    - prompt
                    - media
                  properties:
                    prompt:
                      type: string
                      maxLength: 5000
                      description: 使用 Image 1、Image 2、Video 1 和 Video 2 指代素材。
                    negative_prompt:
                      type: string
                      maxLength: 500
                    media:
                      type: array
                      minItems: 1
                      maxItems: 6
                      items:
                        $ref: '#/components/schemas/Media'
                parameters:
                  $ref: '#/components/schemas/GenerationParameters'
              example:
                model: wan2.7-r2v
                input:
                  prompt: Image 1 中的人物走过 Video 1 中的街道。
                  media:
                    - type: reference_image
                      url: https://example.com/character.png
                    - type: reference_video
                      url: https://example.com/street.mp4
                parameters:
                  resolution: 720P
                  ratio: '16:9'
                  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:
            - reference_image
            - reference_video
            - first_frame
        url:
          type: string
          description: 参考素材 URL；图片也支持 Base64 Data URL。
        reference_voice:
          type: string
          format: uri
          description: 参考图片或视频主体的公开 WAV/MP3 音色 URL。
    GenerationParameters:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 720P
            - 1080P
          default: 1080P
        ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
          default: '16:9'
          description: 传入 first_frame 时忽略。
        duration:
          type: integer
          minimum: 2
          maximum: 15
          default: 5
          description: 包含 reference_video 时最大 10 秒，否则最大 15 秒。
        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-r2v
        status:
          type: string
          example: queued
        progress:
          type: integer
          example: 0
        created_at:
          type: integer
          example: 1784520000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````