huggingface / huggingface/diffusers
[Quantization] Add support for Comfy Quants backend
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
Add support for the [Comfy Quant](https://github.com/Comfy-Org/comfy-quants) quantization toolkit
Supported formats: FP8 (E4M3/E5M2), INT8 (W8A8, tensorwise), MXFP8, NVFP4, INT4 (SVDQuant W4A4, AWQ W4A16).
comfy-quants is export-only. The inference needs to run with [`comfy-kitchen`](https://github.com/Comfy-Org/comfy-kitchen)
### Proposed approach
Add a `ComfyQuantConfig` / `ComfyQuantizer` that uses `comfy-kitchen` to wrap weights as a `QuantizedTensor` with the appropriate layout.
```python
from diffusers import FluxTransformer2DModel, ComfyQuantConfig
config = ComfyQuantConfig(compute_dtype=torch.bfloat16)
model = FluxTransformer2DModel.from_single_file(
"path/to/comfy_quant_checkpoint.safetensors",
quantization_config=config,
)
```
### Related
• comfy-quants https://github.com/Comfy-Org/comfy-quants
• comfy-kitchen https://github.com/Comfy-Org/comfy-kitchen
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.