File size: 2,029 Bytes
2abbf4d
 
 
 
 
 
 
 
 
 
 
b4cb0a7
ccb7ed8
b4cb0a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: creativeml-openrail-m
language:
- en
pipeline_tag: text-to-image
tags:
- comfyui
- diffusion-single-file
base_model:
- cyberdelia/CyberRealisticFlux
base_model_relation: quantized
---
### Note: Despite the "FP16" in the filename, the original weights [in this repo](https://huggingface.co/cyberdelia/CyberRealisticFlux) are actually in BF16 instead, which makes them safe for DF11 compression.
For more information (including how to compress models yourself), check out https://huggingface.co/DFloat11 and https://github.com/LeanModels/DFloat11

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.

### How to Use

#### ComfyUI
Follow the instructions here: https://github.com/LeanModels/ComfyUI-DFloat11. Alternatively, you can install my own fork of the DF11 ComfyUI custom node: https://github.com/mingyi456/ComfyUI-DFloat11-Extended instead. After installing the DF11 custom node, use the provided workflow [json](CyberRealistic_Flux_V2.5_FP16-DF11-workflow.json), or simply replace the "Load Diffusion Model" node of an existing Kontext 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](CyberRealistic_Flux_V2.5_FP16-DF11-workflow.png) image.

![](CyberRealistic_Flux_V2.5_FP16-DF11-workflow.png)

#### `diffusers`
Refer to this [model](https://huggingface.co/mingyi456/CyberRealisticFlux-DF11) instead.

### Compression Details

This is the `pattern_dict` for compressing Flux-based models in ComfyUI:

```python
pattern_dict_comfyui = {
    "double_blocks\.\d+": (
        "img_mod.lin",
        "img_attn.qkv",
        "img_attn.proj",
        "img_mlp.0",
        "img_mlp.2",
        "txt_mod.lin",
        "txt_attn.qkv",
        "txt_attn.proj",
        "txt_mlp.0",
        "txt_mlp.2",
    ),
    "single_blocks\.\d+": (
        "linear1",
        "linear2",
        "modulation.lin",
    ),
}
```