mcpField
Q
qwen-image-2

qwen-image-2

github.com/inference-sh创意与媒体789921 次安装2 周前更新
代码仓库

关于 qwen-image-2

这项技能通过 inference.sh CLI 使用 Alibaba Qwen-Image-2.0 模型生成和编辑图像,介绍不同模型及参考图、文字设计、分辨率和可复现输出等选项。

主要功能

  1. 01文本生成图像
  2. 02使用参考图编辑图像
  3. 03批量生成与自定义尺寸
  4. 04负面提示词与种子控制
  5. 05Pro 模型支持文字密集设计

适用场景

  1. 01根据文本生成概念图
  2. 02结合多张参考图编辑主体
  3. 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 模型生成和编辑图像。

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.0alibaba/qwen-image-2快良好通用用途
Qwen-Image-2.0-Proalibaba/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
}'

输入选项

参数类型描述
promptstring必填。 要生成或编辑的内容(最多 800 个字符)
reference_imagesarray用于编辑的输入图像(1-3 张)
num_imagesinteger要生成的图像数量(1-6 张)
widthinteger输出宽度,单位为像素(512-2048)
heightinteger输出高度,单位为像素(512-2048)
watermarkboolean添加“Qwen-Image”水印
negative_promptstring要避免的内容(最多 500 个字符)
prompt_extendboolean启用提示词改写(默认:true)
seedinteger用于确保可复现的随机种子(0-2147483647)

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

输出

字段类型描述
imagesarray生成或编辑后的图像(PNG 格式)
output_metaobject包含尺寸和数量的元数据

提示词技巧

文本渲染(使用 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-2qwen-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