Skip to main content
POST
/
vendors
/
alibaba
/
v1
/
wan2.5-i2i-preview
/
generation
Create Generation Task
curl --request POST \
  --url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.5-i2i-preview/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "images": [
    "<string>"
  ],
  "negative_prompt": "<string>",
  "size": "1280*1280",
  "n": 4,
  "seed": 1073741823,
  "prompt_extend": false,
  "safety_filter": true
}
'
{
  "task_info": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "pending",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

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.

This API is compatible with Alibaba’s Tongyi Wanxiang (Wan2) models. Please refer to Alibaba Cloud’s official documentation for more details.

Overview

Edit and transform images using the wan2.5-i2i-preview model with text prompts and reference images.

Key Features

  • Support for up to 3 reference images
  • Longer prompts (up to 2000 characters)
  • Flexible output resolution and aspect ratio

Image Requirements

PropertyRequirement
FormatsJPEG, JPG, PNG, BMP, WEBP
Dimensions[384, 5000] pixels for both width and height
Max file size10MB per image
Max images3 images
InputPublic 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

{
  "prompt": "Change the dress to a vintage style lace gown",
  "images": ["https://example.com/image1.jpg"],
  "n": 1
}

With Two Reference Images

{
  "prompt": "Combine these two images into a single portrait scene",
  "images": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "size": "1280*720",
  "n": 4
}

With Negative Prompt

{
  "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 Base64 Image

{
  "prompt": "Add a colorful background to this portrait",
  "images": ["data:image/jpeg;base64,/9j/4AAQSkZJRg..."],
  "size": "960*1280",
  "n": 2
}

Parameters

images

  • Required: Yes
  • Max items: 3
  • Description: Array of image URLs or Base64 encoded data

n (Number of Images)

  • Range: 1-4
  • Default: 4
  • Note: Directly affects cost (cost = unit price × number of images)

seed (Random Seed)

  • Range: 0 to 2,147,483,647
  • Purpose: Improves reproducibility of results
  • Behavior: When n > 1, generates seeds as: seed, seed+1, seed+2, etc.

prompt_extend (Prompt Rewriting)

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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

Text description for the desired edit (max 2000 characters)

Maximum string length: 2000
images
string[]
required

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

Maximum array length: 3
negative_prompt
string

Negative prompt (max 500 characters)

Maximum string length: 500
size
string | null
default:1280*1280

Output image resolution (format: "width*height")

Default: 1280*1280 Total pixels: [768*768, 1440*1440], aspect ratio: [1:4, 4:1]

n
integer
default:4

Number of images to generate (1-4)

Required range: 1 <= x <= 4
seed
integer

Random seed [0, 2147483647]

Required range: 0 <= x <= 2147483647
prompt_extend
boolean
default:false

Enable intelligent prompt rewriting (improves short prompts but increases processing time)

safety_filter
boolean | null
default:true

Enable content safety filter. Defaults to true. Set to false to disable content safety inspection.

Response

202 - application/json

Accepted - Task created successfully

task_info
object