AlperKTS commited on
Commit
06ffeb6
·
verified ·
1 Parent(s): 646f4f5

Update README.md with selective FP8 quantization details and licensing

Browse files
Files changed (1) hide show
  1. README.md +62 -1
README.md CHANGED
@@ -1,5 +1,66 @@
1
  ---
2
  license: other
3
- license_name: krea2
4
  license_link: https://www.krea.ai/krea-2-licensing
 
 
 
 
 
 
 
 
5
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: other
3
+ license_name: krea-2-license
4
  license_link: https://www.krea.ai/krea-2-licensing
5
+ tags:
6
+ - text-to-image
7
+ - image-generation
8
+ - dit
9
+ - fp8
10
+ - comfyui
11
+ - krea
12
+ - krea2
13
  ---
14
+
15
+ # Krea 2 OSS - Optimized FP8 Weights (Turbo)
16
+
17
+ This repository provides an optimized **FP8 (float8_e4m3fn) weight-only quantized version** of the newly released **Krea 2 OSS (Turbo)** transformer.
18
+
19
+ This optimization reduces the model size from the original **24.76 GiB (BF16)** down to **12.01 GiB**, making it highly accessible and runnable on standard consumer hardware (such as 16GB and 24GB GPUs) without sacrificing output quality.
20
+
21
+ ## ⚠️ Licensing & Disclaimer
22
+ - **Original Model Creators**: All credit goes to [KREA.ai](https://www.krea.ai) for the original research, architecture, and weights.
23
+ - **License**: This model is subject to the **KREA 2 License Agreement**. Please read and comply with the official license terms before using these weights: [KREA 2 Licensing Terms](https://www.krea.ai/krea-2-licensing).
24
+ - **Purpose**: This repository is a community-contributed utility. It does not claim ownership of the original model or architecture. Its sole purpose is to provide optimized, consumer-hardware-friendly weights for the open-source community.
25
+
26
+ ---
27
+
28
+ ## 🛠️ Quantization Details (Quality-First FP8)
29
+
30
+ Unlike generic global quantization scripts that aggressively convert every parameter (which often degrades generation details or introduces NaN/promotion calculation errors in neural networks), this model was quantized using a **selective weight-only strategy**:
31
+
32
+ 1. **Targeted Quantization**: Only 2D floating-point weight matrices (`.weight` keys with `ndim >= 2` and element count `> 1024`) were quantized to `torch.float8_e4m3fn`.
33
+ 2. **Preserved Precision**:
34
+ - All 1D vectors, biases, and normalization scales are kept in their native high-precision (`float32` / `bfloat16`).
35
+ - Highly sensitive projection/modulation layers (such as `LastLayer.modulation.lin` vectors) are **completely preserved** in high-precision. This prevents typical mathematical promotion bugs (such as `BFloat16` and `Float8` promotion issues in PyTorch) and retains original output fidelity.
36
+ 3. **Weight Comparison**:
37
+ - **Tensors Quantized to FP8**: 266 tensors.
38
+ - **Tensors Kept in Native Precision**: 166 tensors.
39
+ - **Size Reduction**: **24.76 GiB ➔ 12.01 GiB** (~51.5% VRAM / disk savings!).
40
+
41
+ ---
42
+
43
+ ## 🚀 How to Use in ComfyUI
44
+
45
+ These weights are fully compatible with custom native ComfyUI nodes designed for the Krea2 pipeline.
46
+
47
+ ### 1. Model Placement
48
+ Download the `krea2_turbo_fp8.safetensors` file from this repository and place it in your ComfyUI models folder:
49
+ - Path: `ComfyUI/models/unet/` OR `ComfyUI/models/diffusion_models/` OR `ComfyUI/models/krea2/`
50
+
51
+ ### 2. Pipeline Dependencies
52
+ To run Krea 2 OSS, you will also need the original text encoder and VAE:
53
+ - **Text Encoder**: Qwen3-VL-4B-Instruct (`Qwen/Qwen3-VL-4B-Instruct` on Hugging Face).
54
+ - **VAE**: Qwen-Image Autoencoder (`Qwen/Qwen-Image` subfolder `vae`).
55
+
56
+ ### 3. Recommended Generation Parameters (Turbo)
57
+ - **Resolution**: 1024x1024 (up to 2048x2048)
58
+ - **Steps**: 8
59
+ - **CFG Scale**: 0.0 (Turbo model works best with 0 CFG)
60
+ - **Mu**: 1.15
61
+ - **Sampler / Scheduler**: Standard Flow Matching Timesteps
62
+
63
+ ---
64
+
65
+ ## 🤝 Acknowledgements
66
+ Special thanks to the **KREA.ai** team for releasing Krea 2 to the open-source community. For any commercial licensing inquiries or details about the model, please visit [krea.ai](https://www.krea.ai).