> ## 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 Image-to-Video

> Use Tongyi Wanxiang Wan2.6 image-to-video model (wan2.6-i2v) to generate smooth videos from first frame image and text prompt, supports automatic dubbing, custom audio and multi-shot narrative

Generate smooth videos from a first-frame image using [Alibaba Cloud](https://tongyi.aliyun.com/wan)'s Tongyi Wanxiang Wan2.6 model.

**Key Features:**

* **First-Frame Driven** - Generate coherent dynamic videos from a first-frame image
* **Smart Audio** - Support automatic audio generation or custom audio sync
* **Multi-Resolution** - Support 720P, 1080P HD output
* **Flexible Duration** - Support 5/10/15 second video generation
* **Multi-Shot Mode** - Support single and multi-shot modes with subject consistency


## OpenAPI

````yaml /en/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 Model Task Scheduling Platform 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: Tongyi Wanxiang Wan2 Image-to-Video
      description: >-
        Use Tongyi Wanxiang Wan2.6 image-to-video model (wan2.6-i2v) to generate
        smooth videos from first frame image and text prompt, supports automatic
        dubbing, custom audio and multi-shot narrative
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bailian.CreateWan2ImageToVideoTaskRequest'
        description: Task parameters
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.CreateTaskResponse'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    bailian.CreateWan2ImageToVideoTaskRequest:
      properties:
        audio:
          description: |-
            Add audio (optional, default true)
            Takes effect when audio_url is empty
            true: automatically add audio to video
            false: no audio, output silent video
          type: boolean
        audio_url:
          description: >-
            Audio file URL (optional, only supported by wan2.5-i2v-preview)

            The model will use this audio to generate video with audio-visual
            sync

            Format: wav, mp3, duration: 3-30s, file size: max 15MB
          type: string
        duration:
          description: |-
            Video duration (optional, default 5 seconds)
            wan2.6-i2v: available values are 5, 10, 15
          enum:
            - 5
            - 10
            - 15
          type: integer
        image_url:
          description: |-
            First frame image URL (required)
            Supports public URLs (HTTP/HTTPS) or Base64 encoding
            Image format: JPEG, JPG, PNG (no transparency), BMP, WEBP
            Image resolution: width and height range [360, 2000] pixels
            File size: max 10MB
          example: >-
            https://media.sinancode.com/uploads/20251217/a6aa177e82d58f6738109807a0548605.webp
          type: string
        model:
          description: >-
            Model name (optional, recommended to leave blank)

            When left blank, the latest version will be used and future upgrades
            will be applied automatically

            Current default: wan2.6-i2v
          enum:
            - wan2.6-i2v
          type: string
        negative_prompt:
          description: |-
            Negative prompt (optional, max 500 characters)
            Describe content you don't want to see in the video
          maxLength: 500
          type: string
        prompt:
          description: >-
            Text prompt (optional, max 2000 characters)

            Describe the elements and visual features you want in the generated
            image

            When using video effect parameters (template), the prompt parameter
            is invalid
          maxLength: 2000
          type: string
        prompt_extend:
          description: >-
            Enable smart prompt rewriting (optional, default true)

            When enabled, uses large language model to intelligently rewrite
            input prompts
          type: boolean
        resolution:
          description: |-
            Resolution tier (optional, default 1080P)
            wan2.6-i2v: available values 720P, 1080P (480P not supported)
          enum:
            - 720P
            - 1080P
          type: string
        seed:
          description: Random seed (optional, range 0-2147483647)
          maximum: 2147483647
          minimum: 0
          type: integer
        shot_type:
          description: >-
            Shot type (optional, default single, only supported by wan2.6-i2v)

            Only takes effect when prompt_extend=true

            single: single-shot video

            multi: multi-shot video (supports multiple shot transitions while
            maintaining subject consistency)
          enum:
            - single
            - multi
          type: string
        template:
          description: |-
            Video effect template name (optional)
            Prompt parameter is invalid when using effects
            Different models support different effect templates
          type: string
        watermark:
          description: >-
            Add watermark (optional, default false)

            Watermark is located at bottom right corner with fixed text "AI
            Generated"
          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: Please use your API Token for authentication

````