Instructions to use Qwen/Qwen-Image-2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Qwen/Qwen-Image-2.1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-2.1", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Qwen-Image-2.1 full BF16 running with 2GB VRAM β ncnn/Vulkan for NVIDIA, AMD, Intel and Apple GPUs
Hi Qwen team and everyone,
I have open-sourced qwenimage-ncnn-vulkan, an ncnn/Vulkan implementation of Qwen-Image-2.1:
https://github.com/nihui/qwenimage-ncnn-vulkan
Converted ncnn models are available here:
https://huggingface.co/nihui-szyl/qwen-image-ncnn
The goal of this project is to make Qwen-Image-2.1 easy to run locally on a wide range of consumer hardware, without requiring CUDA, PyTorch, or a Python runtime.
Highlights
Full BF16 model precision β no weight quantization required
Works with as little as 2 GB of dedicated GPU memory, with model data backed by system memory, no CPU offload, no harddisk offload
Cross-platform Vulkan GPU inference
- NVIDIA
- AMD
- Intel
- Apple Silicon
Windows / Linux / macOS
CPU inference is also supported
No CUDA dependency
No PyTorch dependency
No Python runtime required
Portable standalone executable
Text-to-image generation
Image editing
Up to 10 reference images
Transparent RGBA image generation
Dynamic output resolution
Batch generation
One converted model package supports both text-to-image and image editing.
Example:
qwenimage-ncnn-vulkan \
-p "A small red kite over a quiet lake." \
-s 1024,1024 \
-l 40 \
-o output.png
Image editing:
qwenimage-ncnn-vulkan \
-i input.png \
-p "Change the clothes to a blue jacket." \
-o output.png
The project is still in an early stage, but the main Qwen-Image-2.1 inference pipeline is already working across different GPU vendors and operating systems.
Feedback, testing results, and contributions are very welcome :)
Source code:
https://github.com/nihui/qwenimage-ncnn-vulkan
ncnn models:
https://huggingface.co/nihui-szyl/qwen-image-ncnn
great work!
does it work with RTX 2060?
does it work with RTX 2060?
it even works with GTX1060 π
it even works with GTX1060 π
whats the catch though? and any samples?