Skip to content

Instantly share code, notes, and snippets.

View bemo-git's full-sized avatar

bemo-git

  • Joined May 15, 2026
View GitHub Profile
@bemo-git
bemo-git / flux2-klein-draw-things.py
Created May 22, 2026 18:00
Fix "tensorWritesFailed" for Flux.2 Klein 9B models in Draw Things — handles all CivitAI variants (ComfyUI FP8, BF16, F8_E5M2)
#!/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.