Qwen Image 2.1 open weights image model
Unified text-to-image and image editing, with open weights.
Overview
About this model
Qwen Image 2.1 is an official open-weights image model from the Qwen org on Hugging Face. You can download the weights and run text-to-image and image editing locally with diffusers (QwenImage21Pipeline) on a CUDA GPU, in BF16. The visual generation component has 7B parameters. It supports native transparent (RGBA) images, layer editing, subject extraction, up to 10 reference images, and local edits with circles, painted annotations or masks, with identity preservation. Maximum size is 2048×2048, with listed aspect ratios in that range. For lower memory, call enable_model_cpu_offload(). There is no hosted inference API. The license is the Qwen Research License Agreement, which is not a free-for-commercial-use license.
Get started
Run it on your GPU
Install PyTorch 2.4+, transformers, the latest diffusers, accelerate, and Pillow.
Load QwenImage21Pipeline from Qwen/Qwen-Image-2.1 on a CUDA GPU, in BF16.
For lower memory, call enable_model_cpu_offload() before you generate.
Code
Install and run
Qwen/Qwen-Image-2.1
pip install torch>=2.4.0 pip install transformers>=5.17 pip install git+https://github.com/huggingface/diffusers pip install accelerate pillow
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")pipe = QwenImage21Pipeline.from_pretrained(
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()Needs a CUDA GPU. The text-to-image snippet is the official example from the model card.
Limits
Highlights
- Official Qwen org model with open weights
- Unified text-to-image and image editing
- 7B parameters in the visual generation component, BF16
- Native transparent (RGBA) images, layer editing, and subject extraction
- Up to 10 reference images
- Local edits via circles, painted annotations, or masks, with identity preservation
- Improved typography and portrait lighting
- Up to 2048×2048, with aspect ratios 1:1 (2048×2048), 16:9 (2752×1536), 9:16 (1536×2752), 4:3 (2400×1792), 3:4 (1792×2400), 3:2 (2528×1696), and 2:3 (1696×2528)
- Runs locally with diffusers (QwenImage21Pipeline) on a CUDA GPU
- For lower memory, use enable_model_cpu_offload()
- No hosted inference API
Licensed under the Qwen Research License Agreement. That is not a free-for-commercial-use license. There is no hosted API; you need a CUDA GPU to run it locally.
FAQ
Questions
Can I download Qwen Image 2.1?
Yes. Official open weights are published by the Qwen org on Hugging Face as Qwen/Qwen-Image-2.1.
Is there a hosted or free API?
No. There is no hosted inference API. You run the model locally with diffusers (QwenImage21Pipeline) on a CUDA GPU, in BF16. For lower memory, use enable_model_cpu_offload().
What can the model do?
It is a unified text-to-image and image editing model. It supports native transparent (RGBA) images, layer editing, subject extraction, up to 10 reference images, and local edits via circles, painted annotations, or masks, with identity preservation. Maximum size is 2048×2048, with several listed aspect ratios.
What is the license?
The model is licensed under the Qwen Research License Agreement. That is not a free-for-commercial-use license.
Related