mcpField
Q
qwen-image-2-pro

qwen-image-2-pro

github.com/magentosh创意与媒体443 次安装12 周前更新
代码仓库

关于 qwen-image-2-pro

通过 belt CLI 使用 Alibaba Qwen-Image-2.0-Pro 生成和编辑图像的 skill,支持文字密集型设计、参考图编辑、多张输出和可复现生成。

主要功能

  1. 01文生图
  2. 02渲染文字密集型设计
  3. 03基于参考图编辑
  4. 04生成多个图像版本
  5. 05使用 seed 复现生成

适用场景

  1. 01制作含指定文字的海报
  2. 02生成营销横幅
  3. 03根据参考图编辑图像
  4. 04生成多个 Logo 方案

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/magentosh/superpowers --skill qwen-image-2-pro

安装后在 Claude Code 中输入/qwen-image-2-pro确认已加载。

详细介绍

安装 belt CLI 技能: npx skills add belt-sh/cli

Qwen-Image Pro - 专业图像生成

通过 inference.sh CLI 使用 Alibaba Qwen-Image-2.0-Pro 生成图像。最适合专业文本渲染和复杂设计。

Qwen-Image-2.0-Pro

快速开始

需要 inference.sh CLI(belt)。安装说明

belt login

belt app run alibaba/qwen-image-2-pro --input '{"prompt": "Poster with title \"Welcome!\" in bold blue text"}'

Pro 模型能力

  • 专业文本渲染:支持多行和段落级文本,并呈现精细细节
  • 精细逼真效果:更出色的纹理和照片级真实场景
  • 更强的语义遵循能力:更准确地遵循复杂提示词
  • 复杂设计:非常适合文本与图像组合

示例

基本文本生成图像
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
}'

输入选项

参数类型描述
prompt字符串必填。 要生成或编辑的内容(最多 800 个字符)
reference_images数组用于编辑的输入图像(1-3 张图像)
num_images整数要生成的图像数量(1-6 张)
width整数输出宽度,单位为像素(512-2048)
height整数输出高度,单位为像素(512-2048)
watermark布尔值添加“Qwen-Image”水印
negative_prompt字符串要避免的内容(最多 500 个字符)
prompt_extend布尔值启用提示词改写(默认:true)
seed整数用于确保可复现性的随机种子(0-2147483647)

尺寸限制: 总像素数必须介于 512×512 和 2048×2048 之间。

输出

字段类型描述
images数组生成或编辑的图像(PNG 格式)
output_meta对象包含尺寸和数量的元数据

文本渲染技巧

使用 Pro 模型获得最佳文本效果:

  1. 用引号括起准确文本:"Title: \"Hello World!\""
  2. 指定字体细节:颜色、样式、大小、位置
  3. 禁用 prompt_extend:设置 prompt_extend: false,以实现精确控制
  4. 使用负向提示词:"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"
}

示例工作流

# 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

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']}")

相关技能

# 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

浏览所有图像应用:belt app list --category image

文档

评论

支持 Markdown