curl --request POST \
--url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/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
}
'import requests
url = "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation"
payload = {
"prompt": "<string>",
"images": ["<string>"],
"negative_prompt": "<string>",
"size": "1280*1280",
"n": 4,
"seed": 1073741823,
"prompt_extend": False,
"safety_filter": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
images: ['<string>'],
negative_prompt: '<string>',
size: '1280*1280',
n: 4,
seed: 1073741823,
prompt_extend: false,
safety_filter: true
})
};
fetch('https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'images' => [
'<string>'
],
'negative_prompt' => '<string>',
'size' => '1280*1280',
'n' => 4,
'seed' => 1073741823,
'prompt_extend' => false,
'safety_filter' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"negative_prompt\": \"<string>\",\n \"size\": \"1280*1280\",\n \"n\": 4,\n \"seed\": 1073741823,\n \"prompt_extend\": false,\n \"safety_filter\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"negative_prompt\": \"<string>\",\n \"size\": \"1280*1280\",\n \"n\": 4,\n \"seed\": 1073741823,\n \"prompt_extend\": false,\n \"safety_filter\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"negative_prompt\": \"<string>\",\n \"size\": \"1280*1280\",\n \"n\": 4,\n \"seed\": 1073741823,\n \"prompt_extend\": false,\n \"safety_filter\": true\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Wan 2.6 Image-To-Image Generation
Edit images using the wan2.6-image model with text prompts and reference images.
curl --request POST \
--url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/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
}
'import requests
url = "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation"
payload = {
"prompt": "<string>",
"images": ["<string>"],
"negative_prompt": "<string>",
"size": "1280*1280",
"n": 4,
"seed": 1073741823,
"prompt_extend": False,
"safety_filter": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
images: ['<string>'],
negative_prompt: '<string>',
size: '1280*1280',
n: 4,
seed: 1073741823,
prompt_extend: false,
safety_filter: true
})
};
fetch('https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'images' => [
'<string>'
],
'negative_prompt' => '<string>',
'size' => '1280*1280',
'n' => 4,
'seed' => 1073741823,
'prompt_extend' => false,
'safety_filter' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"negative_prompt\": \"<string>\",\n \"size\": \"1280*1280\",\n \"n\": 4,\n \"seed\": 1073741823,\n \"prompt_extend\": false,\n \"safety_filter\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"negative_prompt\": \"<string>\",\n \"size\": \"1280*1280\",\n \"n\": 4,\n \"seed\": 1073741823,\n \"prompt_extend\": false,\n \"safety_filter\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-image/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"negative_prompt\": \"<string>\",\n \"size\": \"1280*1280\",\n \"n\": 4,\n \"seed\": 1073741823,\n \"prompt_extend\": false,\n \"safety_filter\": true\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}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
{
"prompt": "Replace the character's clothing with traditional Chinese Hanfu",
"images": ["https://example.com/portrait.jpg"],
"n": 1
}
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 Custom Seed
{
"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
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Text description for the desired edit (max 2000 characters)
2000Array 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
3Negative prompt (max 500 characters)
500Output image resolution (format: "width*height")
Default: 1280*1280 Total pixels: [768*768, 1440*1440], aspect ratio: [1:4, 4:1]
Number of images to generate (1-4)
1 <= x <= 4Random seed [0, 2147483647]
0 <= x <= 2147483647Enable intelligent prompt rewriting
Enable content safety filter. Defaults to true. Set to false to disable content safety inspection.
Response
Accepted - Task created successfully
Show child attributes
Show child attributes

