Views
No views yet
[!IMPORTANT] Experimental: This Nunchaku Lite quantized ERNIE-Image-Turbo checkpoint is experimental. APIs and loading behavior may change.
text_encodertransformer/config.json.| Component | Method | Precision | Group size | Rank | Targets |
|---|---|---|---|---|---|
Transformer svdq_w4a4 | Nunchaku Lite | int4 | 64 | 32 | 252 |
Transformer awq_w4a16 | Nunchaku Lite | int4 | 64 | - | 6 |
| Text encoder | bitsandbytes | nf4 4-bit | - | - | 353 modules |
NunchakuLiteQuantizationConfig and the Nunchaku Lite loader path.1pip install git+https://github.com/huggingface/diffusers
2pip install kernels bitsandbyteskernels package, and the text encoder uses bitsandbytes 4-bit modules.1import torch
2from diffusers import ErnieImagePipeline
3
4pipe = ErnieImagePipeline.from_pretrained(
5 "rootonchair/ERNIE-Image-Turbo-nunchaku-lite-int4-bnb4-text-encoder",
6 torch_dtype=torch.bfloat16,
7).to("cuda")
8
9image = pipe(
10 prompt="A modern red armchair in a quiet studio, soft window light, realistic product photography",
11 height=1024,
12 width=1024,
13 num_inference_steps=8,
14 guidance_scale=1.0,
15 use_pe=False,
16).images[0]
17
18image.save("ernie-image-turbo-nunchaku-lite-int4-bnb4-text-encoder.png")num_inference_steps=8guidance_scale=1.0use_pe=False for direct prompt usage, or use_pe=True to enable the inherited prompt enhancertorch_dtype=torch.bfloat16, 1024x1024 output, 8 inference steps, guidance_scale=1.0, and use_pe=False.| Variant | Load time | Generation latency | Avg eval latency | Peak allocated VRAM | Text encoder bnb modules |
|---|---|---|---|---|---|
| INT4 transformer + BNB4 text encoder | 2.744s | 11.323s | 10.753s | 9.330GB | 353 |




save_pretrained() serialization for Nunchaku Lite models is not supported yet.