1. Image
Nebula-API操作文档
🇺🇸English
  • 🇨🇳中文
  • 🇺🇸English
  • Chat
    • General Text Dialogue Interface Document
    • Tongyi Qianwen General Dialogue Interface Document
    • DeepSeek General Dialogue Document
    • GPT Chat General Dialogue Document
    • Grok Model (xAI) General Dialogue Interface Document
  • Image
    • General Image Generation Interface Document
    • Nano Banana Image Generation Interface Document
    • Tongyi Qianwen Text to Image Model Interface Document
    • Tongyi Qianwen Image Editing Model Interface Document
  • Video
    • Sora-2 interface document
    • Alibaba Wanxiang Wan2.5 Tu Sheng Video Interface Document
    • Google Veo Video Model Interface Document
    • General Video Generation Interface Document
  • AI App
    • Cherry Studio Integration Guide
    • LangChain Development Framework Integration Guide
    • Cursor Code Editor Integration Guide
    • Claude Code and other client integration guidelines
    • Cline (VS Code) AI Programming Assistant Integration Guide
    • Immersive Translation Integration Guide
  • Real time conversation
    • Realtime real-time conversation document
  1. Image

Tongyi Qianwen Image Editing Model Interface Document

1. Interface Basic Information#

Model Name: qwen-image-edit-plus / qwen-image-edit-plus-2025-10-30 (Qwen Image Editing Model)
Base URL: https://llm.ai-nebula.com/v1/images/generations
Authentication Method: Bearer Token
Auth Token: Bearer sk-xxxxxxxxxx
Core Capabilities:
✅ Single Image Editing (1 input image)
✅ Multi-Image Fusion (2-3 input images)
✅ Modify Text in Image
✅ Add/Remove/Move Objects
✅ Change Subject Action
✅ Transfer Image Style
✅ Enhance Image Details
❌ Pure Text-to-Image Not Supported (Input image required)
Image Input: 1-3 images (Supports URL or Base64)
Image Output: 1-6 images
Billing Method: Per image billing (¥0.18/image, Official price ¥0.2/image)
Official Documentation: Alibaba Cloud Bailian Model Interface Documentation (qwen-image-edit-plus)

1.1 Core Parameters Description#

Parameter NameTypeRequiredDescriptionExample Value
modelstringYesModel nameqwen-image-edit-plus
promptstringYesImage editing instruction (text prompt)"The girl in image 1 sits down in the pose of image 3 wearing the black dress from image 2"
parametersobjectYesGeneration parametersSee description below

1.2 Request Parameter Structure#

qwen-image-edit-plus uses a simplified format:
{
 "model": "qwen-image-edit-plus",
 "prompt": "Image editing instruction",
 "parameters": {
  "n": 2,             // Number of output images (1-6)
  "negative_prompt": "",      // Negative prompt (Optional)
  "watermark": false,       // Watermark (Optional, default false)
  "seed": 12345          // Random seed (Optional)
 },
 "contents": [
  {
   "role": "user",
   "parts": [
    { "image": "https://..." }, // 1st image (Required)
    { "image": "https://..." }, // 2nd image (Optional)
    { "image": "https://..." }, // 3rd image (Optional)
    { "text": "Editing instruction" }    // Text instruction (Required, placed at the end)
   ]
  }
 ]
}

1.3 Image Input Requirements#

Image Format#

Supported Formats: JPG, JPEG, PNG, BMP, TIFF, WEBP
Number of Images: 1-3 images
Input Method: URL or Base64 encoding

Image Specifications#

Resolution: Both width and height must be within the range of 384-3072 pixels
File Size: Not exceeding 10MB
Aspect Ratio: No limit

Base64 Encoding Format#

data:{mime_type};base64,{base64_data}
MIME Type Mapping:
JPEG/JPG: image/jpeg
PNG: image/png
BMP: image/bmp
TIFF: image/tiff
WEBP: image/webp
Example:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...

2. Single Image Editing#

2.1 Modify Text in Image#

Use a single image to precisely modify the text content within the image:

2.2 Add/Remove Objects#

Add or delete objects in the image:

2.3 Style Transfer#

Change the artistic style of the image:

2.4 Change Subject Action#

Modify the action/pose of a person or animal:

3. Multi-Image Fusion#

3.1 Clothing Transfer (2-Image Fusion)#

Apply clothing from one image to a person in another image:

3.2 Pose Transfer (3-Image Fusion)#

Combine elements from multiple images:

3.3 Scene Fusion#

Fuse elements from multiple images into one scene:

4. Advanced Features#

4.1 Using Negative Prompts#

Exclude unwanted effects via negative prompts:
Common Negative Prompt Scenarios:
Person Editing: "distortion, deformation, extra limbs, wrong proportions, uncoordinated, distorted face"
Style Transfer: "over-rendered, distortion, mismatched colors, unnatural, inconsistent style"
Text Editing: "blurred text, typos, distorted font, unclear strokes, overlapping text"
Object Editing: "unnatural, sense of violation, obvious seams, wrong shadows, incorrect perspective"
Multi-Image Fusion: "uncoordinated, obvious seams, mismatched lighting, inconsistent tone, stitching marks"

4.2 Random Seed (Seed)#

Using the same seed parameter keeps the generation content relatively stable:
Note:
Seed range: [0, 2147483647]
Using the same seed produces similar (but not guaranteed identical) results.
If seed is not provided, the algorithm automatically uses a random seed.

4.3 Batch Generation (n Parameter)#

Generate multiple variants in a single request:
n Parameter Range: 1-6 images
Billing Note: Billed by the number of generated images, generating 6 images = 6 images × ¥0.18 = ¥1.08

5. Response Handling#

5.1 Response Format#

A successful response (Status Code 200) returns JSON containing image data:
{
 "code": 200,
 "msg": "Operation successful",
 "data": {
  "data": [
   {
    "url": "https://dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com/xxx.png?Expires=xxx",
    "b64_json": "",
    "revised_prompt": ""
   },
   {
    "url": "https://dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com/yyy.png?Expires=xxx",
    "b64_json": "",
    "revised_prompt": ""
   }
  ],
  "created": 1762415000,
  "metadata": {
   "output": {
    "choices": [
     {
      "finish_reason": "stop",
      "message": {
       "content": [
        { "image": "https://..." },
        { "image": "https://..." }
       ],
       "role": "assistant"
      }
     }
    ]
   },
   "usage": {
    "width": 1248,
    "image_count": 2,
    "height": 832
   },
   "request_id": "bf37ca26-0abe-98e4-8065-xxxxxx"
  }
 }
}

5.2 Response Field Description#

Field PathTypeDescription
codeintResponse status code, 200 indicates success
msgstringResponse message
data.data[]arrayGenerated image array
data.data[].urlstringImage URL address (valid for approx. 24 hours)
data.createdintGeneration timestamp
data.metadataobjectManufacturer's original response data
data.metadata.usage.image_countintNumber of images generated
data.metadata.usage.widthintImage width
data.metadata.usage.heightintImage height

5.3 Error Handling#

If the request fails, an error message will be returned:
{
 "code": 400,
 "msg": "Parameter Error: Image quantity exceeds limit",
 "data": null
}
Common Error Codes:
400: Parameter error (e.g., incorrect image format, size over limit, etc.)
401: Authentication failed (Invalid or expired API key)
403: Insufficient permissions or balance
429: Request too frequent, rate limit exceeded
500: Internal Server Error

6. Best Practices#

6.1 Multi-Image Editing Prompt Tips#

Explicit Image Marking#

When processing multiple images, you must use "Image 1", "Image 2", "Image 3" to refer explicitly:
✅ Good Prompt (Explicit marking):
"The girl in image 1 sits down in the pose of image 3 wearing the black dress from image 2"
❌ Bad Prompt (Missing marking):
"Girl sits down wearing a black dress"

Describe Desired Effect in Detail#

Providing detailed descriptions leads to better editing results:
✅ Good Prompt:
"The girl in image 1 sits down in the pose of image 3 wearing the black dress from image 2, keep her clothing, hairstyle and expression unchanged, movement is natural and smooth, lighting and shadows remain consistent"
❌ Simple Prompt:
"Girl in image 1 changes clothes"

6.2 Image Input Suggestions#

Image Quality#

✅ Use high-resolution, clear images
✅ Ensure sufficient lighting and moderate contrast
❌ Avoid blurred, too dark, or too bright images

Image Content#

✅ Clear subject, simple background
✅ Reasonable composition, correct proportions
❌ Avoid overly complex scenes

Image Size#

Minimum: 384×384 pixels
Maximum: 3072×3072 pixels
Recommended: 1024×1024 to 2048×2048 pixels

6.3 Negative Prompt Strategy#

Use appropriate negative prompts based on different editing types:
Edit TypeRecommended Negative Prompts
Person Editing"distortion, deformation, extra limbs, wrong proportions, uncoordinated, face distortion"
Style Transfer"over-rendered, distortion, mismatched colors, unnatural, inconsistent style"
Text Editing"blurred text, typos, distorted font, unclear strokes, overlapping text"
Object Editing"unnatural, sense of violation, obvious seams, wrong shadows, incorrect perspective"
Multi-Image Fusion"uncoordinated, obvious seams, mismatched lighting, inconsistent tone, stitching marks"

6.4 Parameter Combination Suggestions#

Usage Scenarionnegative_promptwatermarkseed
Quick Test1-2""falseNot set
High Quality Output3-4Detailed descriptionfalseNot set
Batch Generation6Brief descriptionfalseNot set
Stable Reproduction1Detailed descriptionfalseFixed value

7. Billing Instructions#

7.1 Billing Method#

qwen-image-edit-plus uses a per-image billing model:
Official Price: ¥0.20/image
System Price: ¥0.18/image (10% off)
Billing Unit: Billed based on the number of successfully generated images
Unified Price: Same price for all output sizes

7.2 Billing Example#

Generate 2 images: 2 images × ¥0.18 = ¥0.36
Generate 6 images: 6 images × ¥0.18 = ¥1.08

7.3 Billing Log Format#

After successful generation, the system records billing info:
{
 "content": "Image generation: 2 images × ¥0.18 = ¥0.36",
 "modelName": "qwen-image-edit-plus",
 "quota": 12329,
 "quotaDollar": "0.049316"
}

8. Frequently Asked Questions (FAQ)#

Q1: Does qwen-image-edit-plus support pure Text-to-Image?#

A: No. qwen-image-edit-plus is an image editing model and must be provided with at least 1 input image. For pure Text-to-Image functionality, please use qwen-image-plus or doubao-seedream-4-0-250828.

Q2: How many images can be uploaded at most?#

A: Supports up to 3 images input simultaneously. Use 1 image for single image editing, and 2-3 images for multi-image fusion.

Q3: How many images can be generated at once?#

A: You can control the output quantity via the n parameter, ranging from 1-6 images.

Q4: How long is the generated image valid?#

A: The image URL is valid for approximately 24 hours. It is recommended to download and save it immediately after receiving the response, or upload it to your own storage service.

Q5: How to refer to different images during multi-image editing?#

A: You must use "Image 1", "Image 2", "Image 3" in the prompt to explicitly refer to the corresponding images, for example:
"The girl in image 1 sits down in the pose of image 3 wearing the black dress from image 2"
If not explicitly marked, unexpected editing results may occur.

Q6: What image formats are supported for input?#

A: Supports URL and Base64 encoding:
URL: Directly provide the image's HTTP/HTTPS link
Base64: Format data:image/{type};base64,{data}

Q7: How to improve editing quality?#

A: Suggestions:
1.
Use high-resolution, clear input images.
2.
Provide detailed, specific editing instructions.
3.
Explicitly use "Image 1", "Image 2" markers during multi-image editing.
4.
Use negative prompts reasonably to exclude unwanted effects.
5.
Appropriately adjust the n parameter to generate multiple variants for selection.

Q8: What is the use of the seed parameter?#

A: The seed (random seed) can keep the generation result relatively stable. Using the same seed, same input, and parameters can produce similar (but not guaranteed identical) outputs. Suitable for:
Reproducing specific effects
A/B testing
Batch production of images with similar styles

Q9: Can watermarks be removed?#

A: Yes, set watermark: false. Note: Removing watermarks may have usage restrictions according to Alibaba Cloud's terms of service; please comply with relevant regulations.

Q10: What image output formats are supported?#

A: The image URL returned by qwen-image-edit-plus points to a PNG format image, ensuring high-quality output. The aspect ratio of the output image matches the input image.

9. Complete Request Examples#

Example 1: Single Image Editing - Modify Text (Python)#

Example 2: Multi-Image Fusion - Clothing Transfer (Node.js)#

Example 3: Base64 Image Input (Python)#

10. Performance Optimization Suggestions#

10.1 Image Preprocessing#

Preprocessing images before uploading can improve editing results:
1.
Compress Image: Compress large images to a reasonable size (recommended 1024-2048 pixels).
2.
Adjust Brightness: Ensure the image has sufficient lighting and moderate contrast.
3.
Crop Irrelevant Content: Remove unnecessary background or edges.

10.2 Prompt Optimization#

1.
Be Specific: Avoid vague descriptions; give specific editing requirements.
2.
Step-by-Step Description: Complex edits can be broken down into multiple simple steps.
3.
Preserve Original Features: Explicitly state which original features need to be preserved.

10.3 Batch Generation Strategy#

If you need to generate a large number of images:
1.
Concurrent Requests: Initiate multiple independent requests simultaneously.
2.
Use Queue: Implement request queue management to avoid exceeding rate limits.
3.
Error Retry: Implement automatic retry mechanism to handle temporary failures.

11. Quick Reference#

Model Parameters Cheat Sheet#

ParameterValue
Model Nameqwen-image-edit-plus, qwen-image-edit-plus-2025-10-30
Supported FunctionImage Editing (Image-to-Image)
Image Input1-3 images (URL or Base64)
Image Output1-6 images
Input FormatJPG, JPEG, PNG, BMP, TIFF, WEBP
Output FormatPNG
Resolution Limit384-3072 pixels
File Size Limit≤10MB
Response FormatURL (Valid for approx. 24 hours)
Billing MethodPer image billing (¥0.18/image)

Core Functions Cheat Sheet#

FunctionSupportedDescription
Single Image Editing✅1 input image
Multi-Image Fusion✅2-3 input images
Modify Text✅Precise modification of text in image
Add/Remove Objects✅Add or delete objects
Change Action✅Modify person/animal pose
Style Transfer✅Change artistic style
Negative Prompt✅Exclude unwanted elements
Random Seed✅Control generation stability
Pure Text-to-Image❌Must have input image

Parameter Combination Cheat Sheet#

ScenarioImage Countnnegative_promptwatermarkseed
Single Image Edit12-3Brief descriptionfalseNot set
Multi-Image Fusion2-32-4Detailed descriptionfalseNot set
High Quality Output1-33-4Detailed descriptionfalseNot set
Stable Reproduction1-31Detailed descriptionfalseFixed value
Batch Test1-36Brief descriptionfalseNot set

Document Version: v1.0
Update Time: 2025-11-06
Model: Qwen Image Editing Model (qwen-image-edit-plus)
Technical Support: https://llm.ai-nebula.com

Technical Support#

If you have any questions, please contact:
Documentation: https://llm.ai-nebula.com/docs
Technical Support: support@ai-nebula.com
修改于 2025-12-04 07:49:15
上一页
Tongyi Qianwen Text to Image Model Interface Document
下一页
Sora-2 interface document
Built with