Qwen/Qwen-Image-2.1 — new model trending #30 on Hugging Face
Alibaba's Qwen open-sourced Qwen-Image-2.1, a 7B-parameter unified text-to-image generation and editing model with native RGBA transparency.
Alibaba's Qwen team open-sourced Qwen-Image-2.1, a unified text-to-image generation and image editing model with a 7B-parameter visual generation component built from 32 single-stream DiT layers. It natively generates and edits transparent RGBA images, supports up to 10 reference images, and enables local edits via circles, annotations, or masks with identity preservation for people and products. Efficiency comes from mixed-granularity attention and prefix KV cache reuse, with improved typography, portrait lighting, and textures. Weights are available on Hugging Face and ModelScope under the Qwen Research License Agreement.
- 7B-parameter visual generation component using 32 single-stream DiT layers.
- Generates and edits transparent RGBA images natively from text prompts.
- Supports up to 10 reference images and localized edits via masks or circles.
- Mixed-granularity attention and prefix KV cache reuse cut inference cost.
- Licensed under the Qwen Research License Agreement.
Full article428 words · extracted from huggingface.co · click to collapse
<p align="center">
<img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/image2.1/logo.png" width="400"/>
</p>
<p align="center">
🤖 <a href="https://modelscope.cn/models/Qwen/Qwen-Image-2.1">ModelScope</a> |
🤗 <a href="https://huggingface.co/Qwen/Qwen-Image-2.1">HuggingFace</a> |
📑 <a href="https://qwen.ai/blog?id=qwen-image-2.1">Blog</a> |
🖥️ <a href="https://huggingface.co/spaces/Qwen/Qwen-Image-2.1">Demo</a> |
🫨 <a href="https://discord.gg/CV4E9rpNSD">Discord</a>
</p>
## Introduction
We are excited to open-source **Qwen-Image-2.1**, a unified text-to-image generation and image editing model in the Qwen family. With just **7B parameters in its visual generation component** (32 Single-Stream DiT layers), Qwen-Image-2.1 balances generation quality, inference efficiency, and versatility.
Four key improvements define this release:
- **Compact and Efficient** — A lightweight architecture with mixed-granularity attention and prefix KV cache reuse delivers strong image quality at low computational cost.
- **Native Transparency, Unified Creation and Editing** — Generate regular or transparent (RGBA) images from text, edit transparent layers, and extract subjects from photographs—all in one model.
- **Versatile Editing** — Support up to **10 reference images**, specify local edits via circles, painted annotations, or separate masks, and preserve identity for people and products.
- **Realistic Textures and Refined Aesthetics** — Improved typography, portrait lighting, and fine details for more visually compelling results.
<p align="center">
<img src="https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen-Image/image2.1/images/example-01.png" width="100%"/>
</p>
For more details, see the [GitHub repo](https://github.com/QwenLM/Qwen-Image-2.1) and [Blog](https://qwen.ai/blog?id=qwen-image-2.1).
## Quick Start
### Installation
```bash
pip install torch>=2.4.0
pip install transformers>=5.17
pip install git+https://github.com/huggingface/diffusers
pip install accelerate pillow
```
### Text-to-Image
```python
import torch
from diffusers import QwenImage21Pipeline
pipe = QwenImage21Pipeline.from_pretrained(
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16