Qwen Image
Generate high-quality images using Alibaba Cloud's Qwen Image API (通义万相).
Usage
Generate an image (returns URL only):
CODEBLOCK0
Generate and save locally:
CODEBLOCK1
With custom model:
Support qwen-image-max-2025-12-30 qwen-image-plus-2026-01-09 qwen-image-plus
CODEBLOCK2
API Key
You can obtain the API key and run the image generation command in the following order.
- - Get apiKey from
models.providers.bailian.apiKey in INLINECODE4 - Or get from
skills."qwen-image".apiKey in INLINECODE6 - Or get from
DASHSCOPE_API_KEY environment variable - Or Get your API key from: https://dashscope.console.aliyun.com/
Options
Sizes:
- -
1664*928 (default) - 16:9 landscape - INLINECODE9 - Square format
- INLINECODE10 - 9:16 portrait
- INLINECODE11 - 16:9 landscape (smaller)
Additional flags:
- -
--negative-prompt "unwanted elements" - Specify what to avoid - INLINECODE13 - Disable automatic prompt enhancement
- INLINECODE14 - Add watermark to generated image
- INLINECODE15 - Disable SSL certificate verification (use when behind corporate proxy)
Workflow
- 1. Execute the generate_image.py script with the user's prompt
- Parse the script output and find the line starting with INLINECODE16
- Extract the image URL from that line (format:
MEDIA_URL: https://...) - Display the image to the user using markdown syntax: INLINECODE18
- Do NOT download or save the image unless the user specifically requests it
Notes
- - Supports both Chinese and English prompts
- By default, returns image URL directly without downloading
- The script prints
MEDIA_URL: in the output - extract this URL and display it using markdown image syntax: INLINECODE20 - Always look for the line starting with
MEDIA_URL: in the script output and render the image for the user - Default negative prompt helps avoid common AI artifacts
- Images are hosted on Alibaba Cloud OSS with temporary access URLs
Qwen Image
使用阿里云通义万相API生成高质量图像。
使用方法
生成图像(仅返回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-30 qwen-image-plus-2026-01-09 qwen-image-plus
bash
uv run {baseDir}/scripts/generate_image.py --prompt a beautiful sunset over mountains --model qwen-image-plus-2026-01-09 --api-key sk-xxx
API密钥
您可以按以下顺序获取API密钥并运行图像生成命令。
- - 从 ~/.openclaw/openclaw.json 中的 models.providers.bailian.apiKey 获取apiKey
- 或从 ~/.openclaw/openclaw.json 中的 skills.qwen-image.apiKey 获取
- 或从 DASHSCOPEAPIKEY 环境变量获取
- 或从以下网址获取您的API密钥:https://dashscope.console.aliyun.com/
选项
尺寸:
- - 1664928(默认)- 16:9 横向
- 10241024 - 正方形格式
- 7201280 - 9:16 纵向
- 1280720 - 16:9 横向(较小)
附加参数:
- - --negative-prompt 不需要的元素 - 指定要避免的内容
- --no-prompt-extend - 禁用自动提示增强
- --watermark - 为生成的图像添加水印
- --no-verify-ssl - 禁用SSL证书验证(在企业代理后使用时使用)
工作流程
- 1. 使用用户的提示词执行generateimage.py脚本
- 解析脚本输出,找到以 MEDIAURL: 开头的行
- 从该行提取图像URL(格式:MEDIA_URL: https://...)
- 使用Markdown语法向用户展示图像:

- 除非用户特别要求,否则不要下载或保存图像
注意事项
- - 支持中文和英文提示词
- 默认直接返回图像URL,无需下载
- 脚本输出中会打印 MEDIAURL: - 提取此URL并使用Markdown图像语法显示:

- 始终在脚本输出中查找以 MEDIAURL: 开头的行,并为用户渲染图像
- 默认的负面提示有助于避免常见的AI伪影
- 图像托管在阿里云OSS上,使用临时访问URL