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

# Wan 2.5 Text-To-Image Preview Generation

> Generate images from text prompts using the wan2.5-t2i-preview model.

<Note>
  This API is compatible with Alibaba's Tongyi Wanxiang (Wan2) models. Please refer to Alibaba Cloud's [official documentation](https://www.alibabacloud.com/help/en/model-studio/text-to-image-v2-api-reference) for more details.
</Note>

## Overview

Generate high-quality images from text descriptions using the wan2.5-t2i-preview model. This is the latest Wan2.5 text-to-image model with enhanced capabilities.

## Key Features

* Support for longer prompts (up to 2000 characters)
* Flexible resolution and aspect ratio support
* Higher quality output

## Resolution Guidelines

* **Default**: 1280\*1280
* **Total pixels**: Between 768\*768 and 1440\*1440
* **Aspect ratio**: Between 1:4 and 4:1
* **Example**: 768\*2700 is valid (meets pixel and ratio requirements)

### Common Aspect Ratios

| Aspect Ratio | Recommended Resolution   |
| ------------ | ------------------------ |
| 1:1          | 1280\*1280 or 1024\*1024 |
| 2:3          | 800\*1200                |
| 3:2          | 1200\*800                |
| 3:4          | 960\*1280                |
| 4:3          | 1280\*960                |
| 9:16         | 720\*1280                |
| 16:9         | 1280\*720                |
| 21:9         | 1344\*576                |

## Prompt Tips

For best results:

* Be specific and descriptive about what you want to see
* Include details about style, composition, lighting, and mood
* Use the negative prompt to exclude unwanted elements
* For short prompts, consider enabling `prompt_extend` for enhanced results

## Example Requests

### Basic Text-to-Image

```json theme={null}
{
  "prompt": "A sitting orange cat with a joyful expression, lively and cute, realistic and accurate",
  "n": 1
}
```

### With Negative Prompt

```json theme={null}
{
  "prompt": "A serene mountain landscape at sunset, dramatic clouds, vibrant colors",
  "negative_prompt": "low resolution, error, worst quality, low quality, incomplete, extra fingers, poor proportions",
  "size": "1280*720",
  "n": 4
}
```

### High-Resolution Portrait

```json theme={null}
{
  "prompt": "Professional portrait of a woman in business attire, studio lighting, shallow depth of field, professional photography",
  "size": "960*1280",
  "n": 1,
  "prompt_extend": false
}
```

### With Custom Seed for Reproducibility

```json theme={null}
{
  "prompt": "Futuristic cityscape at night, neon lights, cyberpunk style",
  "size": "1344*576",
  "n": 1,
  "seed": 12345
}
```

## Parameters

### n (Number of Images)

* **Range**: 1-4
* **Default**: 4
* **Note**: Directly affects cost (cost = unit price × number of images)
* **Recommendation**: Set to 1 during testing to minimize costs

### prompt\_extend (Prompt Rewriting)

* **Default**: false
* **Effect**: Uses AI to enhance and expand short prompts
* **Trade-off**: Improves results for short prompts but increases processing time

### seed (Random Seed)

* **Range**: 0 to 2,147,483,647
* **Purpose**: Improves reproducibility of results
* **Note**: Due to probabilistic nature, same seed doesn't guarantee identical results
* **Behavior**: When n > 1, generates seeds as: seed, seed+1, seed+2, etc.


## OpenAPI

````yaml api-reference/endpoint/alibaba/wan2.5-t2i-preview/wan2.5-t2i-preview.yaml POST /vendors/alibaba/v1/wan2.5-t2i-preview/generation
openapi: 3.1.0
info:
  title: Wan2.5-t2i-preview API
  description: Wan2.5 Text-to-Image Preview Model API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.mulerouter.ai/
security:
  - bearerAuth: []
paths:
  /vendors/alibaba/v1/wan2.5-t2i-preview/generation:
    post:
      summary: Create Generation Task
      description: Generate images from text prompts using the wan2.5-t2i-preview model.
      operationId: wan25_t2i_preview_generation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan25T2IPreviewRequest'
        required: true
      responses:
        '202':
          description: Accepted - Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreatedResponse'
components:
  schemas:
    Wan25T2IPreviewRequest:
      type: object
      additionalProperties: false
      properties:
        prompt:
          type: string
          description: Text description for the image (max 2000 characters).
          maxLength: 2000
        negative_prompt:
          anyOf:
            - type: string
            - type: 'null'
          description: Negative prompt describing unwanted content (max 500 characters)
          maxLength: 500
        size:
          type: string
          description: |-
            Image resolution in format "width\*height" (e.g., "1280\*1280")

            Default: 1280\*1280
            Total pixels: [768\*768, 1440\*1440], aspect ratio: [1:4, 4:1]
          default: 1280*1280
        'n':
          type: integer
          description: Number of images to generate (1-4)
          minimum: 1
          maximum: 4
          default: 4
        prompt_extend:
          type: boolean
          description: >-
            Enable intelligent prompt rewriting (improves short prompts but
            increases processing time)
          default: false
        seed:
          type: integer
          description: Random seed for reproducibility [0, 2147483647]
          minimum: 0
          maximum: 2147483647
        safety_filter:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Enable content safety filter. Defaults to true. Set to false to
            disable content safety inspection.
          default: true
      required:
        - prompt
    TaskCreatedResponse:
      type: object
      additionalProperties: true
      properties:
        task_info:
          $ref: '#/components/schemas/TaskInfoCreated'
    TaskInfoCreated:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: UUID of the task
          format: uuid
        status:
          type: string
          description: Task status (pending when created)
          enum:
            - pending
        created_at:
          type: string
          description: Task creation timestamp (ISO 8601)
          format: date-time
        updated_at:
          type: string
          description: Task last update timestamp (ISO 8601)
          format: date-time
      required:
        - id
        - status
        - created_at
        - updated_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````