Update README.md
Browse files
README.md
CHANGED
|
@@ -11,4 +11,43 @@ pipeline_tag: text-to-image
|
|
| 11 |
tags:
|
| 12 |
- comfyui
|
| 13 |
- diffusion-single-file
|
| 14 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
tags:
|
| 12 |
- comfyui
|
| 13 |
- diffusion-single-file
|
| 14 |
+
---
|
| 15 |
+
For more information (including how to compress models yourself), check out https://huggingface.co/DFloat11 and https://github.com/LeanModels/DFloat11
|
| 16 |
+
|
| 17 |
+
Feel free to request for other models for compression as well, although compressing models that do not use the Flux architecture might be slightly tricky for me.
|
| 18 |
+
|
| 19 |
+
### How to Use
|
| 20 |
+
|
| 21 |
+
#### ComfyUI
|
| 22 |
+
Follow the instructions here: https://github.com/LeanModels/ComfyUI-DFloat11. After installing the DF11 custom node, use the provided workflow [json](flux1-dev-DF11-workflow.json), or simply replace the "Load Diffusion Model" node of an existing Flux workflow with the "DFloat11 Model Loader" node. If you run into any issues, feel free to leave a comment. The workflow is also embedded in the below [png](flux1-dev-DF11-workflow.png) image.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
|
| 26 |
+
#### `diffusers`
|
| 27 |
+
Refer to this [model](https://huggingface.co/DFloat11/FLUX.1-dev-DF11) instead.
|
| 28 |
+
|
| 29 |
+
### Compression Details
|
| 30 |
+
|
| 31 |
+
This is the `pattern_dict` for compressing Flux-based models in ComfyUI:
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
pattern_dict_comfyui = {
|
| 35 |
+
"double_blocks\.\d+": (
|
| 36 |
+
"img_mod.lin",
|
| 37 |
+
"img_attn.qkv",
|
| 38 |
+
"img_attn.proj",
|
| 39 |
+
"img_mlp.0",
|
| 40 |
+
"img_mlp.2",
|
| 41 |
+
"txt_mod.lin",
|
| 42 |
+
"txt_attn.qkv",
|
| 43 |
+
"txt_attn.proj",
|
| 44 |
+
"txt_mlp.0",
|
| 45 |
+
"txt_mlp.2",
|
| 46 |
+
),
|
| 47 |
+
"single_blocks\.\d+": (
|
| 48 |
+
"linear1",
|
| 49 |
+
"linear2",
|
| 50 |
+
"modulation.lin",
|
| 51 |
+
),
|
| 52 |
+
}
|
| 53 |
+
```
|