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

> Use Tongyi Wanxiang Wan2 series models to generate images, supports three models: wan2.5-t2i-preview/wan2.2-t2i-flash/wan2.2-t2i-plus

Generate images from text using [Alibaba Cloud](https://tongyi.aliyun.com/wan)'s Tongyi Wanxiang Wan2 series models.

**Key Features:**

* **Multiple Model Options** - Support wan2.5-t2i-preview/wan2.2-t2i-flash/wan2.2-t2i-plus
* **Native Multimodal** - Single architecture supporting text and image modality input/output
* **Native Chinese** - Industry-leading Chinese understanding, use Chinese prompts directly
* **Complex Instruction Understanding** - Support camera movements and complex continuous instructions


## OpenAPI

````yaml /en/openapi.yaml POST /generate/bailian/wan2-text-to-image
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-text-to-image:
    post:
      tags:
        - public
      summary: Tongyi Wanxiang Wan2 Text-to-Image
      description: >-
        Use Tongyi Wanxiang Wan2 series models to generate images, supports
        three models: wan2.5-t2i-preview/wan2.2-t2i-flash/wan2.2-t2i-plus
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bailian.CreateWan2TextToImageTaskRequest'
        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.CreateWan2TextToImageTaskRequest:
      properties:
        model:
          description: >-
            Model selection (optional, default wan2.5-t2i-preview)

            Available values: wan2.5-t2i-preview, wan2.2-t2i-flash,
            wan2.2-t2i-plus
          enum:
            - wan2.5-t2i-preview
            - wan2.2-t2i-flash
            - wan2.2-t2i-plus
          type: string
        negative_prompt:
          description: Negative prompt (optional, max 500 characters)
          maxLength: 500
          type: string
        prompt:
          description: Positive prompt (required, max 2000 characters)
          maxLength: 2000
          minLength: 1
          type: string
        seed:
          description: Random seed (optional, range 0-2147483647)
          maximum: 2147483647
          minimum: 0
          type: integer
        size:
          description: >-
            Image size (optional, default 1280*1280)

            wan2.5-t2i-preview: total pixels [768*768, 1440*1440], aspect ratio
            [1:4, 4:1]

            wan2.2 and below: width/height [512, 1440]
          type: string
      required:
        - prompt
      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

````