qwen-image-gen

阿里云千问文生图模型(Qwen-Image)技能,支持图像生成。当用户要求AI生成图片、画图、文生图、text-to-image,或提到千问、阿里云生图时使用。支持中英文提示词,可指定画面尺寸、风格参数等。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "qwen-image-gen" with this command: npx skills add lanlan314/qwen-image-gen-lan

千问文生图技能 (qwen-image-gen)

快速使用

基本文生图(同步接口,推荐)

使用 qwen-image-2.0-pro 模型(效果最佳):

curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -d '{
    "model": "qwen-image-2.0-pro",
    "input": {
      "messages": [{
        "role": "user",
        "content": [{"text": "你的提示词"}]
      }]
    },
    "parameters": {
      "negative_prompt": "低分辨率,低画质,肢体畸形,手指畸形",
      "prompt_extend": true,
      "watermark": false,
      "size": "2048*2048"
    }
  }'

可用模型

模型特点推荐场景
qwen-image-2.0-pro效果最好,文字渲染强首选
qwen-image-2.0速度快,效果均衡加速场景
qwen-image-max真实感最强写实摄影
qwen-image-plus价格优惠常规使用

常用参数

参数说明默认值
size分辨率,格式 宽*高2048*2048
n生成数量(2.0系列1-6张,其他1张)1
prompt_extend智能优化提示词true
watermark添加水印false
negative_prompt反向提示词-
seed随机种子(0-2147483647)随机

推荐分辨率

qwen-image-2.0系列:

  • 2048*2048 - 1:1 方图(默认)
  • 2688*1536 - 16:9 宽屏
  • 1536*2688 - 9:16 竖屏
  • 2368*1728 - 4:3
  • 1728*2368 - 3:4

qwen-image-max / plus系列:

  • 1664*928 - 16:9(默认)
  • 1328*1328 - 1:1
  • 928*1664 - 9:16
  • 1472*1104 - 4:3
  • 1104*1472 - 3:4

执行流程

  1. 检查 API Key:确保 DASHSCOPE_API_KEY 环境变量已设置
  2. 构建请求:根据用户提示词和参数构建 JSON 请求
  3. 调用 API:使用 curl 发送同步请求
  4. 解析结果:从响应中提取图像 URL
  5. 返回结果:将图像 URL 返回给用户

响应示例

成功时返回:

{
  "output": {
    "choices": [{
      "finish_reason": "stop",
      "message": {
        "content": [{
          "image": "https://dashscope-result-xxx.png?Expires=xxx"
        }]
      }
    }]
  },
  "usage": {
    "height": 2048,
    "image_count": 1,
    "width": 2048
  },
  "request_id": "xxx"
}

注意:图像 URL 有效期 24 小时,请及时保存!

错误处理

常见错误码:

  • InvalidApiKey - API Key 无效或未设置
  • InvalidParameter - 参数错误
  • RateLimitExceed - 请求过于频繁

参考资料

详细 API 文档和异步接口说明请参阅 references/api.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

通义晓蜜 - 智能外呼

触发阿里云晓蜜外呼机器人任务,自动批量拨打电话。适用于批量外呼、客户回访、满意度调查、简历筛查约面试等场景。可从前置工具或节点获取外呼名单。

Registry SourceRecently Updated
General

Letterboxd Watchlist

Scrape a public Letterboxd user's watchlist into a CSV/JSONL list of titles and film URLs without logging in. Use when a user asks to export, scrape, or mirror a Letterboxd watchlist, or to build watch-next queues.

Registry SourceRecently Updated
General

Seedance Video Generation

Generate AI videos using ByteDance Seedance. Use when the user wants to: (1) generate videos from text prompts, (2) generate videos from images (first frame, first+last frame, reference images), or (3) query/manage video generation tasks. Supports Seedance 1.5 Pro (with audio), 1.0 Pro, 1.0 Pro Fast, and 1.0 Lite models.

Registry SourceRecently Updated
4.2K17jackycser
General

Universal Skills Manager

The master coordinator for AI skills. Discovers skills from multiple sources (SkillsMP.com, SkillHub, and ClawHub), manages installation, and synchronization...

Registry SourceRecently Updated