qwen-image-2
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQwen-Image - Alibaba Image Generation
Qwen-Image - 阿里巴巴AI图片生成工具
Generate and edit images with Alibaba Qwen-Image-2.0 models via inference.sh CLI.

通过inference.sh CLI工具,使用阿里巴巴Qwen-Image-2.0模型生成和编辑图片。

Quick Start
快速开始
Requires inference.sh CLI (). Get installation instructions:infshnpx skills add inference-sh/skills@agent-tools
bash
infsh login
infsh app run alibaba/qwen-image-2 --input '{"prompt": "A serene mountain landscape at sunset"}'需要安装inference.sh CLI()。获取安装指引:infshnpx skills add inference-sh/skills@agent-tools
bash
infsh login
infsh app run alibaba/qwen-image-2 --input '{"prompt": "A serene mountain landscape at sunset"}'Models
模型列表
| Model | App ID | Speed | Text Rendering | Best For |
|---|---|---|---|---|
| Qwen-Image-2.0 | | Fast | Good | General use |
| Qwen-Image-2.0-Pro | | Standard | Professional | Posters, text-heavy designs |
| 模型 | 应用ID | 速度 | 文字渲染能力 | 适用场景 |
|---|---|---|---|---|
| Qwen-Image-2.0 | | 快速 | 良好 | 通用场景 |
| Qwen-Image-2.0-Pro | | 标准速度 | 专业级 | 海报、文字密集型设计 |
Search Qwen Image Apps
搜索Qwen Image应用
bash
infsh app list --search "qwen image"bash
infsh app list --search "qwen image"Examples
使用示例
Basic Text-to-Image
基础文本转图片
bash
infsh app run alibaba/qwen-image-2 --input '{
"prompt": "A futuristic cityscape at sunset with flying cars"
}'bash
infsh app run alibaba/qwen-image-2 --input '{
"prompt": "A futuristic cityscape at sunset with flying cars"
}'Multiple Images
生成多张图片
bash
infsh app run alibaba/qwen-image-2 --input '{
"prompt": "Minimalist logo design for a coffee shop",
"num_images": 4
}'bash
infsh app run alibaba/qwen-image-2 --input '{
"prompt": "Minimalist logo design for a coffee shop",
"num_images": 4
}'Custom Resolution
自定义分辨率
bash
infsh app run alibaba/qwen-image-2-pro --input '{
"prompt": "Panoramic mountain landscape with northern lights",
"width": 1536,
"height": 1024
}'bash
infsh app run alibaba/qwen-image-2-pro --input '{
"prompt": "Panoramic mountain landscape with northern lights",
"width": 1536,
"height": 1024
}'Text-Heavy Poster (Pro)
文字密集型海报(Pro版)
bash
infsh 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
}'bash
infsh 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
}'Image Editing (Multi-Reference)
多参考图编辑
bash
infsh 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"}
]
}'bash
infsh 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"}
]
}'With Negative Prompt
使用负面提示词
bash
infsh app run alibaba/qwen-image-2-pro --input '{
"prompt": "Professional headshot portrait, studio lighting",
"negative_prompt": "low resolution, blurry, deformed, oversaturated"
}'bash
infsh app run alibaba/qwen-image-2-pro --input '{
"prompt": "Professional headshot portrait, studio lighting",
"negative_prompt": "low resolution, blurry, deformed, oversaturated"
}'Reproducible with Seed
固定随机种子生成可复现图片
bash
infsh app run alibaba/qwen-image-2 --input '{
"prompt": "Abstract geometric art in blue and gold",
"seed": 12345
}'bash
infsh app run alibaba/qwen-image-2 --input '{
"prompt": "Abstract geometric art in blue and gold",
"seed": 12345
}'Input Options
输入参数选项
| Parameter | Type | Description |
|---|---|---|
| string | Required. What to generate or edit (max 800 chars) |
| array | Input images for editing (1-3 images) |
| integer | Number of images to generate (1-6) |
| integer | Output width in pixels (512-2048) |
| integer | Output height in pixels (512-2048) |
| boolean | Add "Qwen-Image" watermark |
| string | Content to avoid (max 500 chars) |
| boolean | Enable prompt rewriting (default: true) |
| integer | Random seed for reproducibility (0-2147483647) |
Size constraint: Total pixels must be between 512×512 and 2048×2048.
| 参数 | 类型 | 说明 |
|---|---|---|
| 字符串 | 必填。生成或编辑的内容描述(最多800字符) |
| 数组 | 用于编辑的输入图片(1-3张) |
| 整数 | 生成图片的数量(1-6张) |
| 整数 | 输出图片宽度(512-2048像素) |
| 整数 | 输出图片高度(512-2048像素) |
| 布尔值 | 是否添加“Qwen-Image”水印 |
| 字符串 | 需要避免生成的内容(最多500字符) |
| 布尔值 | 是否启用提示词自动优化(默认:true) |
| 整数 | 用于结果复现的随机种子(0-2147483647) |
尺寸限制:总像素范围必须在512×512到2048×2048之间。
Output
输出内容
| Field | Type | Description |
|---|---|---|
| array | The generated or edited images (PNG format) |
| object | Metadata with dimensions and count |
| 字段 | 类型 | 说明 |
|---|---|---|
| 数组 | 生成或编辑后的图片(PNG格式) |
| 对象 | 包含图片尺寸和数量的元数据 |
Prompt Tips
提示词技巧
For Text Rendering (use Pro model):
- Put exact text in quotes:
"Title: \"Hello World!\"" - Specify font style, color, position
- Set for precise control
prompt_extend: false
Styles: photorealistic, illustration, watercolor, oil painting, digital art, anime, 3D render
Composition: close-up, wide shot, aerial view, macro, portrait, landscape
Lighting: natural light, studio lighting, golden hour, dramatic shadows, neon
文字渲染技巧(请使用Pro模型):
- 将需要精确呈现的文字放在引号中:
"Title: \"Hello World!\"" - 明确指定字体样式、颜色和位置
- 设置以实现精确控制
prompt_extend: false
风格选项:写实风格、插画、水彩画、油画、数字艺术、动漫、3D渲染
构图选项:特写、广角、航拍、微距、人像、风景
光线选项:自然光、影棚光、黄金时刻、戏剧性阴影、霓虹灯光
Sample Workflow
典型工作流
bash
undefinedbash
undefined1. Generate sample input to see all options
1. 生成示例输入以查看所有参数选项
infsh app sample alibaba/qwen-image-2-pro --save input.json
infsh app sample alibaba/qwen-image-2-pro --save input.json
2. Edit the prompt
2. 编辑提示词
3. Run
3. 运行命令
infsh app run alibaba/qwen-image-2-pro --input input.json
undefinedinfsh app run alibaba/qwen-image-2-pro --input input.json
undefinedModel Comparison
模型对比
| Feature | qwen-image-2 | qwen-image-2-pro |
|---|---|---|
| Speed | Faster | Standard |
| Text Rendering | Good | Professional |
| Realism | Standard | Fine-grained |
| Semantic Adherence | Good | Enhanced |
| 特性 | qwen-image-2 | qwen-image-2-pro |
|---|---|---|
| 速度 | 更快 | 标准速度 |
| 文字渲染 | 良好 | 专业级 |
| 真实感 | 标准 | 精细化 |
| 语义贴合度 | 良好 | 增强版 |
Related Skills
相关技能
bash
undefinedbash
undefinedFull platform skill (all 150+ apps)
全平台技能(包含150+应用)
npx skills add inference-sh/skills@agent-tools
npx skills add inference-sh/skills@agent-tools
All image generation models
所有AI图片生成模型
npx skills add inference-sh/skills@ai-image-generation
npx skills add inference-sh/skills@ai-image-generation
Video generation (for image-to-video)
AI视频生成(用于图片转视频)
npx skills add inference-sh/skills@ai-video-generation
Browse all image apps: `infsh app list --category image`npx skills add inference-sh/skills@ai-video-generation
浏览所有图片类应用:`infsh app list --category image`Documentation
官方文档
- Running Apps - How to run apps via CLI
- Streaming Results - Real-time progress updates
- File Handling - Working with images
- 运行应用 - 如何通过CLI运行应用
- 流式结果 - 实时进度更新
- 文件处理](https://inference.sh/docs/api/sdk/files) - 图片文件操作指南