qwen-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Qwen 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-xxx
Generate and save locally:
bash
uv run {baseDir}/scripts/generate_image.py --prompt "一副典雅庄重的对联悬挂于厅堂之中" --size "1664*928" --api-key sk-xxx
With custom model: Support
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
生成图片(仅返回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 Key

API密钥

You can obtain the API key and run the image generation command in the following order.
  • Get apiKey from
    models.providers.bailian.apiKey
    in
    ~/.openclaw/openclaw.json
  • Or get from
    skills."qwen-image".apiKey
    in
    ~/.openclaw/openclaw.json
  • Or get from
    DASHSCOPE_API_KEY
    environment variable
  • Or Get your API key from: https://dashscope.console.aliyun.com/
您可以按照以下步骤获取API密钥并运行图片生成命令。
  • ~/.openclaw/openclaw.json
    中的
    models.providers.bailian.apiKey
    获取apiKey
  • 或从
    ~/.openclaw/openclaw.json
    中的
    skills."qwen-image".apiKey
    获取
  • 或从
    DASHSCOPE_API_KEY
    环境变量获取
  • 或从以下地址获取您的API密钥:https://dashscope.console.aliyun.com/

Options

可选参数

Sizes:
  • 1664*928
    (default) - 16:9 landscape
  • 1024*1024
    - Square format
  • 720*1280
    - 9:16 portrait
  • 1280*720
    - 16:9 landscape (smaller)
Additional flags:
  • --negative-prompt "unwanted elements"
    - Specify what to avoid
  • --no-prompt-extend
    - Disable automatic prompt enhancement
  • --watermark
    - Add watermark to generated image
  • --no-verify-ssl
    - Disable SSL certificate verification (use when behind corporate proxy)
尺寸:
  • 1664*928
    (默认)- 16:9横版
  • 1024*1024
    - 正方形
  • 720*1280
    - 9:16竖版
  • 1280*720
    - 16:9横版(小尺寸)
额外参数:
  • --negative-prompt "unwanted elements"
    - 指定需要避免的元素
  • --no-prompt-extend
    - 禁用自动提示词增强
  • --watermark
    - 为生成的图片添加水印
  • --no-verify-ssl
    - 禁用SSL证书验证(在企业代理环境下使用)

Workflow

工作流程

  1. Execute the generate_image.py script with the user's prompt
  2. Parse the script output and find the line starting with
    MEDIA_URL:
  3. Extract the image URL from that line (format:
    MEDIA_URL: https://...
    )
  4. Display the image to the user using markdown syntax:
    ![Generated Image](URL)
  5. Do NOT download or save the image unless the user specifically requests it
  1. 使用用户的提示词执行generate_image.py脚本
  2. 解析脚本输出,找到以
    MEDIA_URL:
    开头的行
  3. 从该行提取图片URL(格式:
    MEDIA_URL: https://...
  4. 使用markdown语法向用户展示图片:
    ![Generated Image](URL)
  5. 除非用户明确要求,否则不要下载或保存图片

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:
    ![generated image](URL)
  • 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
  • 支持中文和英文提示词
  • 默认直接返回图片URL,不进行下载
  • 脚本会在输出中打印
    MEDIA_URL:
    - 提取该URL并使用markdown图片语法展示:
    ![generated image](URL)
  • 务必在脚本输出中查找以
    MEDIA_URL:
    开头的行,并为用户渲染图片
  • 默认的负面提示词有助于避免常见的AI生成瑕疵
  • 图片托管在阿里云OSS上,使用临时访问URL