用途
Qwen-Image-2.0-Pro 是一个专业图像生成技能,通过 inference.sh 的命令行工具 belt(CLI)调用 Alibaba Qwen-Image-2.0-Pro 模型。其定位适合专业文字渲染和复杂设计,典型用途包括带文字的海报、营销横幅、标志设计等文字与图像结合的场景。
专业模型能力
- 专业文字渲染:支持多行及段落级文字,细节精细。
- 细颗粒度写实:更好的纹理与照片级场景。
- 更强的语义遵循:更准确地跟随复杂提示词。
- 复杂设计:适合文字加图像的组合。
安装与登录
需先安装 belt CLI 技能:
npx skills add belt-sh/cli
随后登录:
belt login
使用方式
基本调用:
belt app run alibaba/qwen-image-2-pro --input '{"prompt": "Poster with title \"Welcome!\" in bold blue text"}'
文本转图像示例:
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "A futuristic cityscape at sunset with flying cars"
}'
文字密集型海报示例:
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Healing-style hand-drawn poster featuring three puppies playing with a ball. The main title \"Come Play Ball!\" is prominently displayed at the top in bold, blue cartoon font. Below, the subtitle \"Join the Fun!\" appears in green font.",
"width": 1024,
"height": 1536,
"prompt_extend": false
}'
营销横幅示例:
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Professional marketing banner for summer sale. Large text \"SUMMER SALE\" in white on gradient sunset background. \"50% OFF\" in yellow below. Clean, modern design.",
"width": 1920,
"height": 1080,
"prompt_extend": false,
"negative_prompt": "blurry text, distorted text, low quality"
}'
多张变体示例:
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Minimalist logo design for a coffee shop called \"Bean & Brew\"",
"num_images": 4
}'
图像编辑(风格迁移)示例:
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Make the person from Image 1 wear the outfit from Image 2",
"reference_images": [
{"uri": "https://example.com/person.jpg"},
{"uri": "https://example.com/outfit.jpg"}
],
"num_images": 2
}'
可复现生成示例:
belt app run alibaba/qwen-image-2-pro --input '{
"prompt": "Abstract geometric art in blue and gold",
"seed": 12345
}'
工作流示例:
# 1. 生成示例输入以查看所有选项
belt app sample alibaba/qwen-image-2-pro --save input.json
# 2. 编辑提示词
# 3. 运行
belt app run alibaba/qwen-image-2-pro --input input.json
Python SDK 示例:
from inferencesh import inference
client = inference()
# Text-heavy poster
result = client.run({
"app": "alibaba/qwen-image-2-pro",
"input": {
"prompt": "Poster with title \"Welcome!\" in bold blue text at top",
"width": 1024,
"height": 1536,
"prompt_extend": False
}
})
print(result["output"])
# Stream live updates
for update in client.run({
"app": "alibaba/qwen-image-2-pro",
"input": {
"prompt": "Professional product photography of a watch"
}
}, stream=True):
if update.get("progress"):
print(f"progress: {update['progress']}%")
if update.get("output"):
print(f"output: {update['output']}")
输入选项
| 参数 | 类型 | 说明 |
|---|---|---|
| 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:设置 prompt_extend: false 以获得精确控制
- 使用负面提示词:"blurry text, distorted text, low quality"
示例提示词结构:
Poster with the title "GRAND OPENING" in large red serif font at the top center.
Below, the date "March 15, 2024" in smaller black text.
Background: elegant gold and white gradient.
Style: professional, clean, modern.
推荐负面提示词:
{
"negative_prompt": "low resolution, low quality, deformed limbs, deformed fingers, oversaturated, waxy, no facial details, overly smooth, AI-like, chaotic composition, blurry text, distorted text"
}
相关技能
# Standard Qwen-Image (faster, general use)
npx skills add inference-sh/skills@qwen-image
# 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
# Browse all image apps
belt app list --category image
文档
- Running Apps - How to run apps via CLI
- Streaming Results - Real-time progress updates
- File Handling - Working with images
适用场景与限制
适用场景包括图文混排的海报、营销横幅、标志设计、写实场景生成,以及基于参考图的图像编辑与风格迁移。限制方面:prompt 最多 800 字符,negative_prompt 最多 500 字符;参考图 1-3 张;单次生成 1-6 张;宽高范围 512-2048,且总像素须在 512×512 与 2048×2048 之间;需具备 inference.sh CLI(belt)及登录凭证。收费、价格等信息暂未提供。