This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Makes Flux.2 Klein 9B (and other Flux2-based) safetensors models importable into Draw Things.app. | |
| Also fixes LoRAs that fail to fuse in Draw Things and MFLUX. | |
| Handles all four model variants automatically: | |
| 1. ComfyUI scaled-FP8 (e.g. rayKlein9b BFS) | |
| Dequantizes F8_E4M3 weights using their per-tensor F32 scales → BF16. | |
| Drops the comfy_quant and weight_scale tensors. |