Text-to-Image
Diffusers
Safetensors
QwenImagePipeline
sdnq
qwen_image
4-bit precision
8-bit precision
Instructions to use Disty0/Qwen-Image-Lightning-SDNQ-uint4-svd-r32 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Disty0/Qwen-Image-Lightning-SDNQ-uint4-svd-r32 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Disty0/Qwen-Image-Lightning-SDNQ-uint4-svd-r32", 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
metadata
license: apache-2.0
base_model:
- vladmandic/Qwen-Lightning
base_model_relation: quantized
library_name: diffusers
tags:
- sdnq
- qwen_image
- 4-bit
4 bit (UINT4 with SVD rank 32) quantization of vladmandic/Qwen-Lightning using SDNQ.
Usage:
pip install git+https://github.com/Disty0/sdnq
import torch
import diffusers
from sdnq import SDNQConfig # import sdnq to register it into diffusers and transformers
pipe = diffusers.QwenImagePipeline.from_pretrained("Disty0/Qwen-Image-Lightning-SDNQ-uint4-svd-r32", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()
prompt = "a tiny astronaut hatching from an egg on the moon, Ultra HD, 4K, cinematic composition."
negative_prompt = " "
image = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
width=1024,
height=1024,
num_inference_steps=8,
true_cfg_scale=1.0,
generator=torch.manual_seed(0),
).images[0]
image.save("qwen-image-lightning-sdnq-uint4-svd-r32.png")
Original BF16 vs SDNQ quantization comparison:

