addlabsviral/Qwen-Image-2.1-Turbo-4bit
4 bit quantization of Qwen/Qwen-Image-2.1-Turbo using bnb
for text-to-image generation in 8 steps. Transformer + text encoder are 4-bit,
VAE stays float32 at inference. Weights saved as safetensors, ready to run with accelerate + bitsandbytes.
Quantized from Qwen/Qwen-Image-2.1-Turbo — same QwenImage21Pipeline, same saved 8-step sample_sigmas, CFG=1.
BEST for consumer gpu non active run in 8 steps with same quality as base model
Install
pip install git+https://github.com/huggingface/diffusers.git
pip install "transformers>=5.17.0" accelerate bitsandbytes pillow sentencepiece
Use
import torch
from diffusers import QwenImage21Pipeline
pipe = QwenImage21Pipeline.from_pretrained(
"addlabsviral/Qwen-Image-2.1-Turbo-bnb-fp4",
dtype=torch.bfloat16,
).to("cuda")
image = pipe(
prompt="Cinematic portrait of an astronaut on Mars, golden hour lighting",
width=1024,
height=1024,
use_kv_cache=True,
generator=torch.Generator("cpu").manual_seed(42),
).images[0]
image.save("output.png")
Samples (generated on HF Job, rtx-pro-6000, NF4 weights, 8-step)

Notes
- 4-bit BNB weights (
double_quant=False) — expect small quality drift vs BF16, big VRAM savings. - Keep
use_kv_cache=True, default 8-step schedule,CFG=1. - License follows the base model (Qwen Research License).