qwen-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQwen Image
Qwen Image
Generate high-quality images using Alibaba Cloud's Qwen Image API (通义万相).
使用阿里云的Qwen Image API(通义万相)生成高质量图片。
Usage
使用方法
Generate an image (returns URL only):
bash
uv run {baseDir}/scripts/generate_image.py --prompt "一副典雅庄重的对联悬挂于厅堂之中" --size "1664*928" --api-key sk-xxxGenerate and save locally:
bash
uv run {baseDir}/scripts/generate_image.py --prompt "一副典雅庄重的对联悬挂于厅堂之中" --size "1664*928" --api-key sk-xxxWith custom model:
Support
qwen-image-max-2025-12-30qwen-image-plus-2026-01-09qwen-image-plusbash
uv run {baseDir}/scripts/generate_image.py --prompt "a beautiful sunset over mountains" --model qwen-image-plus-2026-01-09 --api-key sk-xxx生成图片(仅返回URL):
bash
uv run {baseDir}/scripts/generate_image.py --prompt "一副典雅庄重的对联悬挂于厅堂之中" --size "1664*928" --api-key sk-xxx生成并保存到本地:
bash
uv run {baseDir}/scripts/generate_image.py --prompt "一副典雅庄重的对联悬挂于厅堂之中" --size "1664*928" --api-key sk-xxx使用自定义模型:
支持
qwen-image-max-2025-12-30qwen-image-plus-2026-01-09qwen-image-plusbash
uv run {baseDir}/scripts/generate_image.py --prompt "a beautiful sunset over mountains" --model qwen-image-plus-2026-01-09 --api-key sk-xxxAPI Key
API密钥
You can obtain the API key and run the image generation command in the following order.
- Get apiKey from in
models.providers.bailian.apiKey~/.openclaw/openclaw.json - Or get from in
skills."qwen-image".apiKey~/.openclaw/openclaw.json - Or get from environment variable
DASHSCOPE_API_KEY - Or Get your API key from: https://dashscope.console.aliyun.com/
您可以按照以下步骤获取API密钥并运行图片生成命令。
- 从中的
~/.openclaw/openclaw.json获取apiKeymodels.providers.bailian.apiKey - 或从中的
~/.openclaw/openclaw.json获取skills."qwen-image".apiKey - 或从环境变量获取
DASHSCOPE_API_KEY - 或从以下地址获取您的API密钥:https://dashscope.console.aliyun.com/
Options
可选参数
Sizes:
- (default) - 16:9 landscape
1664*928 - - Square format
1024*1024 - - 9:16 portrait
720*1280 - - 16:9 landscape (smaller)
1280*720
Additional flags:
- - Specify what to avoid
--negative-prompt "unwanted elements" - - Disable automatic prompt enhancement
--no-prompt-extend - - Add watermark to generated image
--watermark - - Disable SSL certificate verification (use when behind corporate proxy)
--no-verify-ssl
尺寸:
- (默认)- 16:9横版
1664*928 - - 正方形
1024*1024 - - 9:16竖版
720*1280 - - 16:9横版(小尺寸)
1280*720
额外参数:
- - 指定需要避免的元素
--negative-prompt "unwanted elements" - - 禁用自动提示词增强
--no-prompt-extend - - 为生成的图片添加水印
--watermark - - 禁用SSL证书验证(在企业代理环境下使用)
--no-verify-ssl
Workflow
工作流程
- Execute the generate_image.py script with the user's prompt
- Parse the script output and find the line starting with
MEDIA_URL: - Extract the image URL from that line (format: )
MEDIA_URL: https://... - Display the image to the user using markdown syntax:
 - Do NOT download or save the image unless the user specifically requests it
- 使用用户的提示词执行generate_image.py脚本
- 解析脚本输出,找到以开头的行
MEDIA_URL: - 从该行提取图片URL(格式:)
MEDIA_URL: https://... - 使用markdown语法向用户展示图片:
 - 除非用户明确要求,否则不要下载或保存图片
Notes
注意事项
- Supports both Chinese and English prompts
- By default, returns image URL directly without downloading
- The script prints in the output - extract this URL and display it using markdown image syntax:
MEDIA_URL: - Always look for the line starting with in the script output and render the image for the user
MEDIA_URL: - Default negative prompt helps avoid common AI artifacts
- Images are hosted on Alibaba Cloud OSS with temporary access URLs
- 支持中文和英文提示词
- 默认直接返回图片URL,不进行下载
- 脚本会在输出中打印- 提取该URL并使用markdown图片语法展示:
MEDIA_URL: - 务必在脚本输出中查找以开头的行,并为用户渲染图片
MEDIA_URL: - 默认的负面提示词有助于避免常见的AI生成瑕疵
- 图片托管在阿里云OSS上,使用临时访问URL