๐ŸŽจ Qwen-Image-2.1

Unified text-to-image generation & image editing model (7B visual component). Native RGBA support, up to 10 reference images, strong typography & identity preservation.

Text-to-Image Image Editing RGBA / Transparency Diffusers 7B DiT Qwen Research License
๐Ÿš€ Try Official Live Demo ๐Ÿ“ฆ Model Card ๐Ÿ™ GitHub
Hardware note: Full open-weight inference needs substantial VRAM (BF16 โ‰ˆ 30 GB+). Free Static Spaces cannot run the model locally. Use the official API-backed demo above, or run the Diffusers snippets on a GPU machine / paid Space.

Key Features

Compact & Efficient 32 single-stream DiT layers, mixed-granularity attention, prefix KV cache reuse.
Native Transparency Generate or edit RGBA images; extract subjects from photos in one model.
Versatile Editing Up to 10 reference images, local edits via masks / annotations, identity preservation.
Refined Aesthetics Improved typography, portrait lighting, and fine detail quality.

Quick Start (Diffusers)

Installation

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

import torch
from diffusers import QwenImage21Pipeline

pipe = QwenImage21Pipeline.from_pretrained(
    "Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
).to("cuda")

image = pipe(
    prompt='A neon shop sign that reads "QWEN IMAGE 2.1", rainy night, reflections on wet pavement',
    width=2048, height=2048,
    num_inference_steps=40,
    generator=torch.Generator("cuda").manual_seed(42),
).images[0]
image.save("t2i_example.png")

Image Editing

from PIL import Image

input_image = Image.open("input.png")

image = pipe(
    prompt="Change the background to a sunset beach",
    image=input_image,
    num_inference_steps=40,
    generator=torch.Generator("cuda").manual_seed(42),
).images[0]
image.save("edit_example.png")

Recommended Settings

Links & Resources

License: Qwen Research License โ€” non-commercial / research use. Commercial use requires a separate agreement with Alibaba.