> ## 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.6 Image-To-Image Generation

> Edit images using the wan2.6-image model with text prompts and reference images.

<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

Edit and transform images using the wan2.6-image model with text prompts and reference images.

## Image Requirements

| Property          | Requirement                                   |
| ----------------- | --------------------------------------------- |
| **Formats**       | JPEG, JPG, PNG, BMP, WEBP                     |
| **Dimensions**    | \[384, 5000] pixels for both width and height |
| **Max file size** | 10MB per image                                |
| **Max images**    | 2 images                                      |
| **Input**         | Public URL or Base64 encoded data             |

## Resolution Guidelines

* **Default**: 1280\*1280
* **Total pixels**: Between 768\*768 and 1440\*1440
* **Aspect ratio**: Between 1:4 and 4:1

## Example Requests

### Basic Image Editing

```json theme={null}
{
  "prompt": "Replace the character's clothing with traditional Chinese Hanfu",
  "images": ["https://example.com/portrait.jpg"],
  "n": 1
}
```

### With Negative Prompt

```json theme={null}
{
  "prompt": "Transform the image into an oil painting style",
  "negative_prompt": "blurry, low quality, distorted",
  "images": ["https://example.com/photo.jpg"],
  "size": "1280*1280",
  "n": 1
}
```

### With Custom Seed

```json theme={null}
{
  "prompt": "Add a colorful sunset background",
  "images": ["https://example.com/portrait.jpg"],
  "size": "1280*720",
  "n": 1,
  "seed": 42
}
```

## Parameters

### images

* **Required**: Yes
* **Max items**: 2
* **Description**: Array of image URLs or Base64 encoded data

### n (Number of Images)

* **Range**: 1-4
* **Default**: 4
* **Note**: Directly affects cost

### prompt\_extend (Prompt Rewriting)

* **Default**: false
* **Effect**: Uses AI to enhance and expand short prompts

### seed (Random Seed)

* **Range**: 0 to 2,147,483,647
* **Purpose**: Improves reproducibility of results


## OpenAPI

````yaml api-reference/endpoint/alibaba/wan2.6-image/wan2.6-image.yaml POST /vendors/alibaba/v1/wan2.6-image/generation
openapi: 3.1.0
info:
  title: Wan2.6-image API
  description: Wan2.6 Image Editing Model API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.mulerouter.ai/
security:
  - bearerAuth: []
paths:
  /vendors/alibaba/v1/wan2.6-image/generation:
    post:
      summary: Create Generation Task
      description: >-
        Edit images using the wan2.6-image model with text prompts and reference
        images.
      operationId: wan26_image_generation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan26ImageRequest'
        required: true
      responses:
        '202':
          description: Accepted - Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreatedResponse'
components:
  schemas:
    Wan26ImageRequest:
      type: object
      additionalProperties: false
      properties:
        prompt:
          type: string
          description: Text description for the desired edit (max 2000 characters)
          maxLength: 2000
        negative_prompt:
          anyOf:
            - type: string
            - type: 'null'
          description: Negative prompt (max 500 characters)
          maxLength: 500
        images:
          type: array
          items:
            type: string
          maxItems: 3
          description: |-
            Array of image URLs or Base64 encoded data (max 3 images)

            Supported formats: JPEG, JPG, PNG, BMP, WEBP
            Dimensions: [384, 5000] pixels for both width and height
            Max file size: 10MB per image
        size:
          anyOf:
            - type: string
            - type: 'null'
          description: |-
            Output image resolution (format: "width\*height")

            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
        seed:
          type: integer
          description: Random seed [0, 2147483647]
          minimum: 0
          maximum: 2147483647
        prompt_extend:
          type: boolean
          description: Enable intelligent prompt rewriting
          default: false
        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
        - images
    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

````