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 Text to Image Model Interface Document

1. Interface Basic Information#

Model Name: qwen-image-plus (Qwen Image Generation Enhanced Version)
Base URL: https://llm.ai-nebula.com/v1/images/generations
Authentication Method: Bearer Token
Auth Token: Bearer sk-xxxxxxxxxx
Core Capabilities:
✅ Text-to-Image (Generate images from pure text descriptions)
✅ Chinese/English Text Rendering (Excels at generating complex text within images)
✅ Various Art Styles
✅ Intelligent Prompt Extension
❌ Does Not Support Image-to-Image
Supported Dimensions: 1328×1328, 1664×928, 928×1664, 1472×1140, 1140×1472
Billing Method: Per image billing (¥0.18/image, Official price ¥0.2/image)
Official Documentation: Alibaba Cloud Bailian Model Interface Documentation (qwen-image-plus)

1.1 Core Parameters Description#

Parameter NameTypeRequiredDescriptionExample Value
modelstringYesModel nameqwen-image-plus
promptstringYesText prompt"A cute orange kitten"
parametersobjectYesGeneration parametersSee description below

1.2 Request Parameter Structure#

qwen-image-plus supports two parameter formats:

Format 1: Simplified Format (Recommended)#

Directly flattened parameters, more concise:
{
 "model": "qwen-image-plus",
 "prompt": "Your prompt content",
 "parameters": {
  "size": "1328*1328",      // Image size (Required)
  "negative_prompt": "",     // Negative prompt (Optional)
  "prompt_extend": true,     // Prompt extension (Optional, default true)
  "watermark": true        // Watermark (Optional, default true)
 }
}

Format 2: Full Format#

Using the full structure with extra and input.messages:
{
 "model": "qwen-image-plus",
 "prompt": "Your prompt content",
 "extra": {
  "input": {
   "messages": [
    {
     "role": "user",
     "content": [
      {
       "text": "Your prompt content"
      }
     ]
    }
   ]
  },
  "parameters": {
   "size": "1328*1328",
   "negative_prompt": "",
   "prompt_extend": true,
   "watermark": true
  }
 }
}
Suggestion: Use Format 1 (Simplified Format), as it is more concise and readable.

1.3 Supported Image Sizes#

SizeAspect RatioUsage Scenarios
1328×13281:1Square images, avatars, social media
1664×92816:9Widescreen, video covers, desktop wallpapers
928×16649:16Mobile vertical screen, short video covers
1472×11404:3Landscape photos
1140×14723:4Vertical photos, posters

2. Text-to-Image Functionality#

2.1 Basic Text-to-Image (Square 1:1)#

Generate a square image:

2.2 Widescreen Image Generation (16:9)#

Generate a landscape image with a 16:9 widescreen ratio:

2.3 Vertical Image Generation (9:16)#

Generate a poster suitable for a mobile vertical screen:

3. Advanced Features#

3.1 Text Rendering (Core Advantage)#

qwen-image-plus excels at generating complex text within images, supporting Chinese/English text, multi-line layout, and paragraph-level text generation:
Text Rendering Usage Scenarios:
Poster design (with titles and explanatory text)
Couplets, Calligraphy works
Product packaging design (with brand text)
Advertisement images (with slogans)
Educational charts (with labels)

3.2 Negative Prompt#

Use negative prompts to exclude unwanted elements:
Common Negative Prompt Scenarios:
Exclude low quality: "blur, noise, low resolution, pixelated"
Exclude specific elements: "watermark, text, logo, copyright sign"
Exclude styles: "cartoon, anime, abstract, realistic"
Exclude defects: "distortion, deformation, extra limbs, wrong proportions"

3.3 Prompt Extension#

Control whether to automatically extend and optimize prompts via the prompt_extend parameter:

Enable Prompt Extension (Recommended)#

The system will automatically extend "City under sunset" into a more detailed description to improve the generation result.

Disable Prompt Extension#

If your prompt is already very detailed, you can turn off extension:
Prompt Extension Suggestions:
✅ Short prompts: Enable extension (prompt_extend: true)
❌ Detailed prompts: Disable extension (prompt_extend: false)
✅ Need precise control: Disable extension
✅ Rapid creation: Enable extension

3.4 Watermark Control#

Control whether to add a watermark to the generated image via the watermark parameter:
Note: Disabling watermarks may violate certain terms of use; please choose carefully.

4. Response Handling#

4.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-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com/...",
    "b64_json": "",
    "revised_prompt": ""
   }
  ],
  "created": 1762411334,
  "metadata": {
   "output": {
    "choices": [
     {
      "finish_reason": "stop",
      "message": {
       "content": [
        {
         "image": "https://..."
        }
       ],
       "role": "assistant"
      }
     }
    ],
    "task_metric": {
     "FAILED": 0,
     "SUCCEEDED": 1,
     "TOTAL": 1
    }
   },
   "request_id": "c9c7658e-a78e-4f3d-b59c-c25ab83c833b",
   "usage": {
    "height": 1328,
    "image_count": 1,
    "width": 1328
   }
  }
 }
}

4.2 Response Field Description#

Field PathTypeDescription
codeintResponse status code, 200 indicates success
msgstringResponse message
data.data[]arrayArray of generated images
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

4.3 Error Handling#

If the request fails, an error message will be returned:
{
 "code": 400,
 "msg": "Parameter Error: Unsupported image size",
 "data": null
}
Common Error Codes:
400: Parameter error (e.g., wrong model name, invalid size format, 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

5. Best Practices#

5.1 Size Selection Suggestions#

Social Media:
WeChat Moments: 1328×1328 (1:1)
Weibo Banner: 1664×928 (16:9)
Douyin (TikTok) Cover: 928×1664 (9:16)
Xiaohongshu: 1140×1472 (3:4)
Design Usage:
Website Banner: 1664×928 (16:9)
Poster: 1140×1472 (3:4) or 928×1664 (9:16)
Product Image: 1328×1328 (1:1) or 1472×1140 (4:3)
Phone Wallpaper: 928×1664 (9:16)
Video Related:
Video Cover: 1664×928 (16:9)
Short Video Cover: 928×1664 (9:16)

5.2 Prompt Optimization Suggestions#

Text Rendering Prompt Tips#

The core advantage of qwen-image-plus is complex text rendering. Clearly state the text content in the prompt:
✅ Good Prompt (Clear text content):
"A poster with the title 'Summer Sale' and subtitle '50% off site-wide', background is a fresh beach scene"
❌ Bad Prompt (Vague description):
"A promotional poster"
✅ Good Prompt (Detailed text layout):
"A Chinese couplet, left scroll 'Spring returns to the earth, thousands of mountains are beautiful', right scroll 'Sun shines on the divine land, all industries prosper', horizontal scroll 'Everything is renewed', background is red Xuan paper, font is regular script in gold"
❌ Bad Prompt (Missing text):
"A Chinese couplet"

General Prompt Tips#

1.
Clarify Composition Direction:
Horizontal: Use "horizontal composition", "widescreen view"
Vertical: Use "vertical composition", "vertical view"
2.
Add High-Quality Keywords:
"High quality", "HD", "Professional photography"
"8k resolution", "Rich details"
3.
Specify Art Style:
"Realistic style", "Oil painting style", "Watercolor"
"Chinese style", "Cyberpunk", "Modern minimalist"
4.
Describe Lighting and Atmosphere:
"Soft lighting", "Dramatic light and shadow"
"Warm tones", "Cool tones"

5.3 Negative Prompt Tips#

Using negative prompts reasonably can significantly improve generation quality:

Scenario 1: Portrait#

{
 "negative_prompt": "blur, low quality, distortion, deformation, extra limbs, wrong proportions, ugly"
}

Scenario 2: Landscape Photo#

{
 "negative_prompt": "blur, noise, overexposure, underexposure, low resolution, watermark"
}

Scenario 3: Product Image#

{
 "negative_prompt": "blur, heavy shadows, excessive reflection, color distortion, messy background"
}

Scenario 4: Text Rendering#

{
 "negative_prompt": "blurred text, typos, distorted font, unclear strokes"
}

5.4 Parameter Combination Suggestions#

Usage Scenariosizeprompt_extendwatermarknegative_prompt
Rapid Creation1328×1328truetrue""
Precise ControlAs neededfalsefalseDetailed description
Text Rendering1328×1328falsetrue"blurred text"
High Quality Output1664×928falsefalse"blur, low quality, noise"
Poster Design928×1664truefalse"messy, low quality"

6. Billing Instructions#

6.1 Billing Method#

qwen-image-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 sizes

6.2 Billing Example#

Generate 1 image: 1 image × ¥0.18 = ¥0.18
Generate 5 images: 5 images × ¥0.18 = ¥0.90

6.3 Billing Log Format#

After successful generation, the system records billing info:
{
 "content": "Image generation: 1 image × ¥0.18 = ¥0.18",
 "modelName": "qwen-image-plus",
 "quota": 12329,
 "quotaDollar": "0.024658"
}

7. Frequently Asked Questions (FAQ)#

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

A: No. qwen-image-plus is a pure Text-to-Image model. It only supports generating images from text descriptions and does not support uploading reference images. If you need Image-to-Image functionality, please use gemini-2.5-flash-image or doubao-seedream-4-0-250828.

Q2: How to generate images with Chinese text?#

A: qwen-image-plus excels at Chinese/English text rendering. Simply state the text content clearly in the prompt:
{
 "prompt": "A poster, title is 'Double 11 Sale', subtitle '50% off site-wide', background is a red gradient"
}
The model will automatically render this text in the generated image.

Q3: 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.

Q4: Can I generate multiple images at once?#

A: The current version of qwen-image-plus generates 1 image per request. If you need to generate multiple images, please initiate multiple concurrent requests.

Q5: Can prompt extension and negative prompts be used together?#

A: Yes! They do not conflict:
prompt_extend: true - System expands your positive prompt
negative_prompt: "..." - Simultaneously applies negative constraints
Recommendation: Short prompt + Enable extension + Add negative prompt for best results.

Q6: How to ensure the generated image has no watermark?#

A: Set watermark: false:
{
 "parameters": {
  "watermark": false
 }
}
Note: Removing watermarks may have usage restrictions according to Alibaba Cloud's terms of service; please comply with relevant regulations.

Q7: What image output formats are supported?#

A: The image URL returned by qwen-image-plus points to a PNG format image, ensuring high-quality output.

Q8: How long does image generation take?#

A: Usually completed within 5-15 seconds, depending on:
Prompt complexity
Image size
Server load

8. Full Request Examples#

Example 1: Product Poster with Text#

Example 2: Chinese Style Calligraphy Couplet#

Example 3: Short Prompt + Auto Extension#

The system will automatically extend "Cyberpunk city" into a detailed description to improve the generation result.

9. Performance Optimization Suggestions#

9.1 Batch Generation#

If you need to generate multiple images, concurrent requests are recommended to improve efficiency:

9.2 Prompt Optimization Strategy#

1.
Short Prompt: Enable prompt_extend: true to let the system optimize automatically.
2.
Detailed Prompt: Disable prompt_extend: false to keep the original description.
3.
Text Rendering: Explicitly mark text content with quotes in the prompt.
4.
Add Negative Words: Exclude common defects (blur, low quality, etc.).

9.3 Caching Strategy#

For requests with identical parameters, it is recommended to cache on the client side:
Cache key: ${prompt}_${size}_${negative_prompt}_${prompt_extend}
Cache time: 1-24 hours depending on business needs.

10. Quick Reference#

Model Parameters Cheat Sheet#

ParameterValue
Model Nameqwen-image-plus
Supported FunctionText-to-Image (Pure text generation)
Core AdvantageComplex Text Rendering (Chinese/English)
Supported Sizes1328×1328, 1664×928, 928×1664, 1472×1140, 1140×1472
Image Input❌ Not Supported
Response FormatURL (Valid for approx. 24 hours)
Billing MethodPer image billing (¥0.18/image)

Core Functions Cheat Sheet#

FunctionSupportedDescription
Text-to-Image✅Generate images from pure text descriptions
Text Rendering✅Excels at Chinese/English text rendering
Prompt Extension✅Optional intelligent extension
Negative Prompt✅Exclude unwanted elements
Watermark Control✅Select whether to add watermark
Image-to-Image❌Not Supported
Multi-Image Fusion❌Not Supported
Conversation Context❌Not Supported

Common Sizes Cheat Sheet#

SizeRatioScenario
1328×13281:1Social media, avatars
1664×92816:9Video cover, landscape
928×16649:16Short video, phone wallpaper
1472×11404:3Landscape photo
1140×14723:4Vertical poster

Parameter Combination Cheat Sheet#

Scenariosizeprompt_extendwatermarknegative_prompt
Rapid Creation1328×1328truetrue""
Text Poster928×1664falsefalse"blurred text"
High Quality Photo1664×928falsefalse"blur, low quality, noise"
Couplet Calligraphy1140×1472falsetrue"blurred text, typos"

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

Appendix: Complete Request Example (Python)#

Appendix: Complete Request Example (Node.js)#


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:13
上一页
Nano Banana Image Generation Interface Document
下一页
Tongyi Qianwen Image Editing Model Interface Document
Built with