rootonchair commited on
Commit
4a52558
·
verified ·
1 Parent(s): 7eb20a5

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -0
README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: baidu/ERNIE-Image-Turbo
4
+ library_name: diffusers
5
+ tags:
6
+ - nunchaku-lite
7
+ - quantized
8
+ - ernie-image
9
+ - ernie-image-turbo
10
+ - text-to-image
11
+ - svdquant
12
+ - int4
13
+ - fp4
14
+ - diffusers
15
+ ---
16
+
17
+ # ERNIE-Image-Turbo Nunchaku Lite
18
+
19
+ This repository contains Nunchaku Lite SVDQuant checkpoints for [baidu/ERNIE-Image-Turbo](https://huggingface.co/baidu/ERNIE-Image-Turbo).
20
+
21
+ - Runtime: [rootonchair/nunchaku-lite](https://github.com/rootonchair/nunchaku-lite.git)
22
+ - Quantization framework: [rootonchair/diffuse-compressor](https://github.com/rootonchair/diffuse-compressor.git)
23
+
24
+ ## Checkpoints
25
+
26
+ | File | Quantization | Rank | Recommended hardware |
27
+ |---|---:|---:|---|
28
+ | `svdq-int4_r32-ernie-image-turbo.safetensors` | INT4 | 32 | Turing, Ampere, Ada |
29
+ | `svdq-nvfp4_r32-ernie-image-turbo.safetensors` | NVFP4 | 32 | Blackwell |
30
+
31
+ ## Benchmark Artifacts
32
+
33
+ Detailed benchmark metadata is available in [`benchmarks/summary.json`](benchmarks/summary.json).
34
+
35
+ ![Benchmark comparison](benchmarks/comparison.png)
36
+
37
+ | BF16 Diffusers | Nunchaku Lite |
38
+ |---|---|
39
+ | ![BF16 Diffusers sample](benchmarks/original_diffusers.png) | ![Nunchaku Lite sample](benchmarks/nunchaku_lite.png) |
40
+
41
+ ## Usage
42
+
43
+ ```python
44
+ import torch
45
+ from diffusers import ErnieImagePipeline
46
+ from nunchaku_lite import load_nunchaku_pipeline
47
+
48
+ pipe = load_nunchaku_pipeline(
49
+ "Baidu/ERNIE-Image-Turbo",
50
+ pipeline_cls=ErnieImagePipeline,
51
+ checkpoint="rootonchair/ERNIE-Image-Turbo-nunchaku-lite/svdq-nvfp4_r32-ernie-image-turbo.safetensors",
52
+ target="ernie_image",
53
+ precision="auto",
54
+ torch_dtype=torch.bfloat16,
55
+ device="cuda",
56
+ ).to("cuda")
57
+
58
+ image = pipe(
59
+ prompt="This is a photograph depicting an urban street scene. Shot at eye level, it shows a covered pedestrian or commercial street. Slightly below the center of the frame, a cyclist rides away from the camera toward the background, appearing as a dark silhouette against backlighting with indistinct details. The ground is paved with regular square tiles, bisected by a prominent tactile paving strip running through the scene, whose raised textures are clearly visible under the light. Light streams in diagonally from the right side of the frame, creating a strong backlight effect with a distinct Tyndall effect-visible light beams illuminating dust or vapor in the air and casting long shadows across the street. Several pedestrians appear on the left side and in the distance, some with their backs to the camera and others walking sideways, all rendered as silhouettes or semi-silhouettes. The overall color palette is warm, dominated by golden yellows and dark browns, evoking the atmosphere of dusk or early morning.",
60
+ height=1264,
61
+ width=848,
62
+ num_inference_steps=8,
63
+ guidance_scale=1.0,
64
+ use_pe=True,
65
+ ).images[0]
66
+
67
+ image.save("output.png")
68
+ ```
69
+
70
+ For non-Blackwell GPUs, use the INT4 checkpoint instead:
71
+
72
+ ```python
73
+ checkpoint="rootonchair/ERNIE-Image-Turbo-nunchaku-lite/svdq-int4_r32-ernie-image-turbo.safetensors"
74
+ ```
75
+
76
+ ## Citation
77
+
78
+ This is a quantized derivative of [baidu/ERNIE-Image-Turbo](https://huggingface.co/baidu/ERNIE-Image-Turbo). Please follow the base model's license and citation guidance.