Qwen Image Generation & Editing API
POSThttps://api.acedata.cloud/qwen-image/images

Generate images or edit 1–3 references with Qwen Image, including batch outputs, synchronous responses, asynchronous tasks, and callbacks.

Request Headers

acceptstring
Specify the format of the response returned by the server. If not specified, the default format is `application/json`.
Please select
authorizationstring
Bearer token

Request Body

modelstringRequired parameter
{'zh-cn': '模型名称。', 'en': 'Model name.'}
promptstringRequired parameter
{'zh-cn': '图像生成或编辑提示词。', 'en': 'Image generation or editing prompt.'}
image_urlsarray
{'zh-cn': '可选的 1–3 张参考图;传入后执行图像编辑。', 'en': 'Optional 1–3 reference images; providing them enables image editing.'}
ninteger
{'zh-cn': '输出图片数量,1–6 张。', 'en': 'Number of output images, from 1 to 6.'}
sizestring
{'zh-cn': '输出尺寸,像素面积需在 512×512 至 2048×2048 之间。', 'en': 'Output dimensions, pixel area must be between 512×512 and 2048×2048.'}
prompt_extendboolean
{'zh-cn': '是否增强提示词。', 'en': 'Whether to enhance the prompt.'}
Please select
prompt_extend_modestring
{'zh-cn': '提示词增强模式;agent 仅用于文生图。', 'en': 'Prompt enhancement mode; agent is text-to-image only.'}
Please select
enable_thinkingboolean
{'zh-cn': '是否启用增强推理。', 'en': 'Whether to enable enhanced reasoning.'}
Please select
negative_promptstring
{'zh-cn': '不希望出现在图像中的内容。', 'en': 'Content to exclude from the image.'}
seedinteger
{'zh-cn': '随机种子。', 'en': 'Random seed.'}
watermarkboolean
{'zh-cn': '是否添加水印。', 'en': 'Whether to add a watermark.'}
Please select
callback_urlstring
{'zh-cn': '异步完成回调地址。', 'en': 'Callback URL for asynchronous completion.'}
asyncboolean
{'zh-cn': '是否立即返回任务 ID。', 'en': 'Whether to return a task ID immediately.'}
Please select

Response

Integration guide

Shell

Python

JavaScript

Java

Go

PHP

Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.

Qwen Image
Allow Use General Balance

When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.