The SDXL quantized weights in this repository (e.g. svdq-*_r32-*.safetensors) are intended to be used with Nunchaku for efficient inference on supported GPUs.
1PSNR: mean=19.3156 p50=18.0907 p90=24.8075 best=28.2158 worst=14.2874 (N=25)
2SSIM: mean=0.787972 p50=0.782514 p90=0.896604 best=0.908375 worst=0.652052 (N=25)
3LPIPS: mean=0.27435 p50=0.240241 p90=0.453806 best=0.0970999 worst=0.524179 (N=25)
Below is the inference performance comparison (Diffusers vs Nunchaku-UNet).
1# Example (select the correct wheel URL for your torch/cuda/python versions)
2pip install https://github.com/nunchaku-ai/nunchaku/releases/download/vX.Y.Z/nunchaku-X.Y.Z+torch2.9-cp311-cp311-linux_x86_64.whl
1import torch
2from diffusers import StableDiffusionXLPipeline
3
4from nunchaku.models.unets.unet_sdxl import NunchakuSDXLUNet2DConditionModel
5from nunchaku.utils import get_precision
6
7MODEL = "dvine_v70" # Replace with the actual model name before publishing (e.g. zavychromaxl_v100)
8REPO_ID = f"tonera/{MODEL}"
9
10if __name__ == "__main__":
11 unet = NunchakuSDXLUNet2DConditionModel.from_pretrained(
12 f"{REPO_ID}/svdq-{get_precision()}_r32-{MODEL}.safetensors"
13 )
14
15 pipe = StableDiffusionXLPipeline.from_pretrained(
16 f"{REPO_ID}",
17 unet=unet,
18 torch_dtype=torch.bfloat16,
19 use_safetensors=True,
20 ).to("cuda")
21
22 prompt = "Make Pikachu hold a sign that says 'Nunchaku is awesome', yarn art style, detailed, vibrant colors"
23 image = pipe(prompt=prompt, guidance_scale=5.0, num_inference_steps=30).images[0]
24 image.save("sdxl.png")