Qwen-Image-2.1 full BF16 running with 2GB VRAM β€” ncnn/Vulkan for NVIDIA, AMD, Intel and Apple GPUs

#33
by nihui-szyl - opened

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?

Sign up or log in to comment