关于 qwen-image-2
这项技能通过 inference.sh CLI 使用 Alibaba Qwen-Image-2.0 模型生成和编辑图像,介绍不同模型及参考图、文字设计、分辨率和可复现输出等选项。
主要功能
- 01文本生成图像
- 02使用参考图编辑图像
- 03批量生成与自定义尺寸
- 04负面提示词与种子控制
- 05Pro 模型支持文字密集设计
适用场景
- 01根据文本生成概念图
- 02结合多张参考图编辑主体
- 03制作指定文字和布局的海报
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ inference-sh/ skills --skill qwen-image-2安装后在 Claude Code 中输入/qwen-image-2确认已加载。
详细介绍
安装 belt CLI 技能:
npx skills add belt-sh/cli
Qwen-Image - Alibaba 图像生成
通过 inference.sh CLI,使用 Alibaba Qwen-Image-2.0 模型生成和编辑图像。

快速开始
需要 inference.sh CLI(
belt)。安装说明
belt login
belt app run alibaba/qwen-image-2 --input '{"prompt": "A serene mountain landscape at sunset"}'
模型
| 模型 | App ID | 速度 | 文本渲染 | 最适用于 |
|---|---|---|---|---|
| Qwen-Image-2.0 | alibaba/qwen-image-2 | 快 | 良好 | 通用用途 |
| Qwen-Image-2.0-Pro | alibaba/qwen-image-2-pro | 标准 | 专业级 | 海报、文字密集型设计 |
搜索 Qwen Image 应用
belt app search "qwen image"
示例
基本的文本生成图像
belt app run alibaba/qwen-image-2 --input '{
"prompt": "A futuristic cityscape at sunset with flying cars"
}'
多张图像
belt app run alibaba/qwen-image-2 --input '{
"prompt": "Minimalist logo design for a coffee shop",
"num_images": 4
}'
自定义分辨率
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Panoramic mountain landscape with northern lights",
"width": 1536,
"height": 1024
}'
文字密集型海报(Pro)
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Poster with title \"Summer Sale!\" in bold red text at the top. Subtitle \"50% Off Everything\" in blue below. Beach background with palm trees.",
"width": 1024,
"height": 1536,
"prompt_extend": false
}'
图像编辑(多参考图)
belt app run alibaba/qwen-image-2 --input '{
"prompt": "Make the girl from Image 1 wear the dress from Image 2 in the pose from Image 3",
"reference_images": [
{"uri": "https://example.com/person.jpg"},
{"uri": "https://example.com/dress.jpg"},
{"uri": "https://example.com/pose.jpg"}
]
}'
使用负面提示词
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Professional headshot portrait, studio lighting",
"negative_prompt": "low resolution, blurry, deformed, oversaturated"
}'
使用种子确保可复现
belt app run alibaba/qwen-image-2 --input '{
"prompt": "Abstract geometric art in blue and gold",
"seed": 12345
}'
输入选项
| 参数 | 类型 | 描述 |
|---|---|---|
prompt | string | 必填。 要生成或编辑的内容(最多 800 个字符) |
reference_images | array | 用于编辑的输入图像(1-3 张) |
num_images | integer | 要生成的图像数量(1-6 张) |
width | integer | 输出宽度,单位为像素(512-2048) |
height | integer | 输出高度,单位为像素(512-2048) |
watermark | boolean | 添加“Qwen-Image”水印 |
negative_prompt | string | 要避免的内容(最多 500 个字符) |
prompt_extend | boolean | 启用提示词改写(默认:true) |
seed | integer | 用于确保可复现的随机种子(0-2147483647) |
尺寸限制: 总像素数必须介于 512×512 和 2048×2048 之间。
输出
| 字段 | 类型 | 描述 |
|---|---|---|
images | array | 生成或编辑后的图像(PNG 格式) |
output_meta | object | 包含尺寸和数量的元数据 |
提示词技巧
文本渲染(使用 Pro 模型):
- 将确切文本放在引号中:
"Title: \"Hello World!\"" - 指定字体样式、颜色和位置
- 设置
prompt_extend: false以实现精确控制
风格:写实摄影、插画、水彩、油画、数字艺术、动漫、3D 渲染
构图:特写、广角镜头、航拍视角、微距、人像、风景
光照:自然光、影棚灯光、黄金时刻、戏剧性阴影、霓虹灯
示例工作流
# 1. Generate sample input to see all options
belt app sample alibaba/qwen-image-2-pro --save input.json
# 2. Edit the prompt
# 3. Run
belt app run alibaba/qwen-image-2-pro --input input.json
模型对比
| 特性 | qwen-image-2 | qwen-image-2-pro |
|---|---|---|
| 速度 | 更快 | 标准 |
| 文本渲染 | 良好 | 专业级 |
| 写实度 | 标准 | 精细 |
| 语义贴合度 | 良好 | 增强 |
相关技能
# Full platform skill (all apps)
npx skills add inference-sh/skills@infsh-cli
# All image generation models
npx skills add inference-sh/skills@ai-image-generation
# Video generation (for image-to-video)
npx skills add inference-sh/skills@ai-video-generation
浏览所有图像应用:belt app list --category image
文档
评论
支持 Markdown