Skip to main content
POST
/
vendors
/
alibaba
/
v1
/
qwen-image-edit-max
/
generation
Create Generation Task
curl --request POST \
  --url https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "images": [
    "<string>"
  ],
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "size": "<string>",
  "n": 1,
  "prompt_extend": true,
  "seed": 1073741823
}
'
{
  "task_info": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "pending",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}
This is the premium tier of Qwen Image Edit model with enhanced quality and capabilities. For more details, refer to the official documentation.

Overview

Edit and enhance images using the qwen-image-edit-max model. This premium image editing model supports multi-image input and output with powerful editing capabilities at a higher quality tier.

Key Features

  • Multi-image support: Input 1-3 images for complex editing tasks
  • Precise text editing: Accurately modify text content in images
  • Object manipulation: Add, delete, or move objects within images
  • Action modification: Change the action or pose of subjects
  • Style transfer: Apply different artistic styles to images
  • Detail enhancement: Improve image clarity and details
  • Image fusion: Combine elements from multiple images (up to 3)
  • Flexible output: Generate 1-6 images per request
  • Premium Quality: Enhanced results compared to the Plus tier

Pricing

$0.075 per image - Premium tier with enhanced quality Compare with Qwen Image Edit Plus: $0.03 per image

Image Requirements

PropertyRequirement
FormatsJPG, JPEG, PNG, BMP, TIFF, WEBP, GIF (first frame only)
ResolutionWidth and height: 384-3072 pixels
File SizeMax 10MB per image
Input Count1-3 images
Input TypePublic URL or Base64-encoded data

Resolution Guidelines

  • Default: Maintains aspect ratio similar to input with resolution close to 1024*1024
  • Custom: Specify width*height with both dimensions in range [512, 2048] pixels
  • Aspect Ratio: Determined by the last input image

Example Requests

Basic Single Image Edit

{
  "images": ["https://example.com/photo.jpg"],
  "prompt": "Change the person's shirt to red"
}

Text Modification

{
  "images": ["https://example.com/sign.jpg"],
  "prompt": "Change the text on the sign from 'OPEN' to 'CLOSED'",
  "n": 1,
  "size": "1024*768"
}

Multi-image Fusion

{
  "images": [
    "https://example.com/person.jpg",
    "https://example.com/background.jpg",
    "https://example.com/object.jpg"
  ],
  "prompt": "Place the person from Image 1 in the background from Image 2, holding the object from Image 3",
  "n": 4,
  "prompt_extend": true
}

Style Transfer with Negative Prompt

{
  "images": ["https://example.com/portrait.jpg"],
  "prompt": "Transform this portrait into a watercolor painting style",
  "negative_prompt": "low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions",
  "size": "1024*1024",
  "n": 2,
  "seed": 42
}

Object Addition

{
  "images": ["https://example.com/room.jpg"],
  "prompt": "Add a modern floor lamp in the left corner of the room",
  "n": 3,
  "prompt_extend": true
}

Parameters

images (Required)

  • Type: Array of strings
  • Count: 1-3 images
  • Format: URL or Base64-encoded image data
  • Note: For multi-image input, reference them as “Image 1”, “Image 2”, “Image 3” in the prompt
  • Aspect Ratio: Output aspect ratio is determined by the last image in the array

prompt (Required)

  • Type: String
  • Max Length: 800 characters
  • Languages: Chinese and English supported
  • Description: Clear instructions for what you want to change or add to the image(s)

negative_prompt

  • Type: String or null
  • Max Length: 500 characters
  • Default: null
  • Purpose: Describe elements you want to avoid in the output
  • Example: “low resolution, error, worst quality, low quality, disfigured”

size

  • Type: String
  • Format: “width*height” (e.g., “1024*768”)
  • Range: Both width and height must be [512, 2048] pixels
  • Default: Auto-adjusted to maintain input aspect ratio near 1024*1024

n (Number of Images)

  • Range: 1-6
  • Default: 1
  • Note: Each image incurs the per-image cost

prompt_extend (Prompt Rewriting)

  • Type: Boolean
  • Default: true
  • Effect: Uses AI to enhance and optimize prompts for better results
  • Recommendation: Especially useful for short or simple prompts

seed (Random Seed)

  • Range: 0 to 2,147,483,647
  • Purpose: Helps ensure consistency across generations
  • Note: Same seed doesn’t guarantee identical results but improves reproducibility

Use Cases

  1. E-commerce: Change product colors, add accessories, or modify backgrounds
  2. Marketing: Update text in promotional images, swap logos, or adjust layouts
  3. Photo Editing: Remove unwanted objects, change clothing, or enhance details
  4. Creative Design: Combine elements from multiple images, apply artistic styles
  5. Content Creation: Generate variations with different actions or compositions

Tips for Best Results

  • Be specific and descriptive in your prompts
  • Use “Image 1”, “Image 2”, “Image 3” when working with multiple images
  • Enable prompt_extend for more polished results
  • Use negative prompts to avoid common quality issues
  • Request multiple outputs (n > 1) to explore variations
  • Specify custom size when aspect ratio control is important

Authorizations

Authorization
string
header
required

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

Body

application/json
images
string[]
required

Array of input image URLs or Base64-encoded images. Supports 1-3 images. For multi-image input, the order defines their sequence. The aspect ratio of the output image is determined by the last image.

Image requirements:

  • Formats: JPG, JPEG, PNG, BMP, TIFF, WEBP, GIF (first frame only)
  • Resolution: Width and height should be between 384 and 3072 pixels
  • Size: No larger than 10 MB
Required array length: 1 - 3 elements

Image URL or Base64-encoded image data

prompt
string
required

Image editing instruction (max 800 characters). Describes the elements and visual features you want in the generated image. When editing multiple images, use "Image 1", "Image 2", "Image 3" to refer to corresponding images. Supports both Chinese and English.

Maximum string length: 800
negative_prompt
string

Negative prompt describing unwanted content (max 500 characters). Used to constrain the image generation. Example: low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions.

Maximum string length: 500
size
string

Output image resolution in format "widthheight" (e.g., "10241024"). Width and height must be in range [512, 2048] pixels. Example: "10241024", "7681024", "512*512"

Leave empty to maintain aspect ratio similar to input image with resolution close to 1024*1024.

n
integer
default:1

Number of images to generate (1-6).

Required range: 1 <= x <= 6
prompt_extend
boolean
default:true

Enable intelligent prompt rewriting. When enabled, a large language model optimizes the positive prompt. Significantly improves results for simple or less descriptive prompts.

seed
integer

Random seed for reproducibility [0, 2147483647]. Using the same seed helps ensure consistency of generated content. Note: Results are not guaranteed to be identical for every call even with the same seed.

Required range: 0 <= x <= 2147483647

Response

202 - application/json

Accepted - Task created successfully

task_info
object