mingyi456 commited on
Commit
303c547
·
verified ·
1 Parent(s): 23db600

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +47 -1
README.md CHANGED
@@ -10,4 +10,50 @@ tags:
10
  base_model:
11
  - Tongyi-MAI/Z-Image-Turbo
12
  base_model_relation: quantized
13
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  base_model:
11
  - Tongyi-MAI/Z-Image-Turbo
12
  base_model_relation: quantized
13
+ ---
14
+ For more information (including how to compress models yourself), check out https://huggingface.co/DFloat11 and https://github.com/LeanModels/DFloat11
15
+
16
+ Feel free to request for other models for compression as well, although models whose architecture I am unfamiliar with might be slightly tricky for me.
17
+
18
+ ### How to Use
19
+
20
+ #### ComfyUI
21
+ Install my own fork of the DF11 ComfyUI custom node: https://github.com/mingyi456/ComfyUI-DFloat11-Extended. After installing the DF11 custom node, use the provided workflow [json](z_image_turbo_bf16-DF11-workflow.json), or simply replace the "Load Checkpoint" node of an existing workflow with the "Load Checkpoint with DFloat11 Unet" node. If you run into any issues, feel free to leave a comment. The workflow is also embedded in the below [png](z_image_turbo_bf16-DF11-workflow.png) image.
22
+
23
+ ![](z_image_turbo_bf16-DF11-workflow.png)
24
+
25
+ #### `diffusers`
26
+ Refer to this [model](https://huggingface.co/mingyi456/Z-Image-Turbo-DF11) instead.
27
+
28
+ ### Compression Details
29
+
30
+ This is the `pattern_dict` for compressing Z-Image-based models in ComfyUI:
31
+
32
+ ```python
33
+ pattern_dict_comfyui = {
34
+ r"noise_refiner\.\d+": (
35
+ "attention.qkv",
36
+ "attention.out",
37
+ "feed_forward.w1",
38
+ "feed_forward.w2",
39
+ "feed_forward.w3",
40
+ "adaLN_modulation.0"
41
+ ),
42
+ r"context_refiner\.\d+": (
43
+ "attention.qkv",
44
+ "attention.out",
45
+ "feed_forward.w1",
46
+ "feed_forward.w2",
47
+ "feed_forward.w3",
48
+ ),
49
+ r"layers\.\d+": (
50
+ "attention.qkv",
51
+ "attention.out",
52
+ "feed_forward.w1",
53
+ "feed_forward.w2",
54
+ "feed_forward.w3",
55
+ "adaLN_modulation.0"
56
+ )
57
+ }
58
+ ```
59
+