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

# Wan2 图生视频

> 使用通义万相 Wan2.6 图生视频模型（wan2.6-i2v）根据首帧图像和文本提示词生成流畅视频，支持自动配音、自定义音频及多镜头叙事

使用[阿里云](https://tongyi.aliyun.com/wan)通义万相 Wan2.6 模型根据首帧图像生成流畅视频。

**模型特点：**

* **首帧驱动** - 基于首帧图像生成连贯动态视频
* **智能配音** - 支持自动配音或自定义音频同步
* **多分辨率** - 支持 720P、1080P 高清输出
* **灵活时长** - 支持 5/10/15 秒视频生成
* **多镜头切换** - 支持单镜头和多镜头模式，保持主体一致性


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/bailian/wan2-image-to-video
openapi: 3.0.0
info:
  contact:
    email: support@sinancode.com
    name: API Support
    url: https://sinancode.com/support
  description: AI 模型任务调度平台 API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://sinancode.com/terms-of-service
  title: TikTomato API
  version: '1.0'
servers:
  - url: https://api.sinancode.com/v1
    description: Production server
security: []
paths:
  /generate/bailian/wan2-image-to-video:
    post:
      tags:
        - public
      summary: 通义万相 Wan2 图生视频
      description: 使用通义万相 Wan2.6 图生视频模型（wan2.6-i2v）根据首帧图像和文本提示词生成流畅视频，支持自动配音、自定义音频及多镜头叙事
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bailian.CreateWan2ImageToVideoTaskRequest'
        description: 任务参数
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.CreateTaskResponse'
        '400':
          description: 参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '404':
          description: 模型不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '500':
          description: 服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    bailian.CreateWan2ImageToVideoTaskRequest:
      properties:
        audio:
          description: |-
            是否添加音频（可选，默认 true）
            当 audio_url 为空时生效
            true：自动为视频添加音频
            false：不添加音频，输出无声视频
          type: boolean
        audio_url:
          description: |-
            音频文件 URL（可选，仅 wan2.5-i2v-preview 支持）
            模型将使用该音频生成视频，实现音画同步
            格式：wav、mp3，时长：3～30s，文件大小：不超过15MB
          type: string
        duration:
          description: |-
            视频时长（可选，默认 5 秒）
            wan2.6-i2v：可选值为 5、10、15
          enum:
            - 5
            - 10
            - 15
          type: integer
        image_url:
          description: |-
            首帧图像 URL（必填）
            支持公网 URL（HTTP/HTTPS）或 Base64 编码
            图像格式：JPEG、JPG、PNG（不支持透明通道）、BMP、WEBP
            图像分辨率：宽度和高度范围为[360, 2000]像素
            文件大小：不超过10MB
          example: >-
            https://media.sinancode.com/uploads/20251217/a6aa177e82d58f6738109807a0548605.webp
          type: string
        model:
          description: |-
            模型名称（可选，建议留空）
            留空时使用最新版本模型，后续模型升级会自动应用
            当前默认：wan2.6-i2v
          enum:
            - wan2.6-i2v
          type: string
        negative_prompt:
          description: |-
            反向提示词（可选，最大 500 字符）
            用来描述不希望在视频画面中看到的内容
          maxLength: 500
          type: string
        prompt:
          description: |-
            文本提示词（可选，最大 2000 字符）
            用来描述生成图像中期望包含的元素和视觉特点
            当使用视频特效参数（template）时，prompt参数无效
          maxLength: 2000
          type: string
        prompt_extend:
          description: |-
            是否开启 prompt 智能改写（可选，默认 true）
            开启后使用大模型对输入 prompt 进行智能改写
          type: boolean
        resolution:
          description: |-
            分辨率档位（可选，默认 1080P）
            wan2.6-i2v：可选值 720P、1080P（不支持 480P）
          enum:
            - 720P
            - 1080P
          type: string
        seed:
          description: 随机种子（可选，范围 0-2147483647）
          maximum: 2147483647
          minimum: 0
          type: integer
        shot_type:
          description: |-
            镜头类型（可选，默认 single，仅 wan2.6-i2v 支持）
            仅当 prompt_extend=true 时生效
            single：单镜头视频
            multi：多镜头视频（支持多个镜头切换，保持主体一致性）
          enum:
            - single
            - multi
          type: string
        template:
          description: |-
            视频特效模板名称（可选）
            使用特效时 prompt 参数无效
            不同模型支持不同的特效模板
          type: string
        watermark:
          description: |-
            是否添加水印（可选，默认 false）
            水印位于视频右下角，文案固定为"AI生成"
          type: boolean
      required:
        - image_url
      type: object
    dto.CreateTaskResponse:
      properties:
        task_id:
          description: Task ID
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
      required:
        - task_id
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: Machine-readable error code (e.g. TASK.INVALID_PARAMS)
          type: string
        message:
          description: User-friendly error message
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 请使用您的 API Token 进行认证

````