{"slug": "fix-tensorwritesfailed-for-flux-2-klein-9b-models-in-draw-things-handles-all-fp8", "title": "Fix \"tensorWritesFailed\" for Flux.2 Klein 9B models in Draw Things — handles all CivitAI variants (ComfyUI FP8, BF16, F8_E5M2)", "summary": "This article describes a Python script that fixes the \"tensorWritesFailed\" import error in Draw Things for Flux.2 Klein 9B models downloaded from CivitAI. The error occurs because Draw Things expects RMSNorm parameters named `key_norm.scale` and `query_norm.scale`, but many fine-tuned and ComfyUI-exported models use `key_norm.weight` and `query_norm.weight`, causing required schema slots to remain empty during validation. The script auto-detects the model variant, renames the norm keys, and optionally dequantizes FP8 weights, outputting a new `-DT.safetensors` file that imports successfully into Draw Things.", "body_md": "(aka Bemo's Draw Things Klein Fix)\nConverts Flux.2 Klein 9B (and other Flux2-based) safetensors models so they import correctly into Draw Things.\nDraw Things' importer throws tensorWritesFailed\nat ~65% for many Flux.2 Klein\nmodels downloaded from CivitAI. The cause: Draw Things expects the RMSNorm\nparameters to be named key_norm.scale\n/ query_norm.scale\n(Black Forest Labs'\noriginal naming), but most fine-tuned and ComfyUI-exported models use\nkey_norm.weight\n/ query_norm.weight\n(PyTorch default). The unrecognised keys\nare silently skipped, then a validation checkpoint at 65% fails because required\nschema slots are empty.\nAuto-detects the model variant and applies the appropriate fix:\nOutput is always <original-name>-DT.safetensors\nalongside the source file.\n- Python 3.8+\nnumpy\n— only needed for ComfyUI FP8 models:pip install numpy\npython3 draw-things-flux2-klein-fix.py path/to/model.safetensors\nThen import the resulting -DT.safetensors\nfile into Draw Things normally.\n⚠️ GRAPHIC NSFW WARNING\nA significant number of the models listed below can be used to generate explicit sexual content. The links will more often than not take you to pages on CivitAI / CivitAI Red that contain graphic sexual imagery and sometimes video. I did not create these models. Links are provided purely for reference and I do not endorse any of the models or content accessible via the links below.\nNo affiliation: This script is not affiliated with Draw Things, Black Forest Labs, CivitAI, or any of the model creators listed below.\nNo warranty: The script creates a new\n-DT.safetensors\nfile and does not modify the original. That said, it is provided as-is with no guarantees. Always verify the output imports correctly before deleting your source file.\nAll of the following Flux.2 Klein 9B checkpoint merges have been run through this script and confirmed to import into Draw Things successfully.\n\"Prefix strip only — norm keys already correctly named\" means the model used\nBlack Forest Labs' original .scale\nnaming convention. For these models, the\noriginal community script (see below) is sufficient on its own.\n\"Prefix strip + norm rename\" and \"Dequantised FP8→BF16 + norm rename\" are additional fixes that only this script performs.\n- ComfyUI FP8 models output approximately 2× the original file size after dequantisation. Vintage Beauties V3 is an unusually large merged model and produces ~33 GB.\n- The script also fixes LoRAs that fail to fuse in Draw Things and MFLUX.\n- Non-Klein architectures (VAEs, text encoders, LLMs) will fail with an error — that is expected, they do not need this fix.\nThe starting point was this community script by kernkraft235 — it strips the model.diffusion_model.\nkey prefix and removes __metadata__\n, which is enough to get some models importing into Draw Things. For models whose norm keys are already named .scale\n(Black Forest Labs' original convention), kernkraft235's script works perfectly and is all you need.\nFor many fine-tuned and ComfyUI-exported models, however, kernkraft235's script ran successfully and produced a converted file — but that file still failed to import into Draw Things. The additional problems are norm keys named .weight\nrather than .scale\n, and in some cases FP8 weights that need dequantising before Draw Things can read them. This script handles both on top of kernkraft235's original work.\nI have no background in Python or ML. This script was built entirely with Claude Code — I described the symptoms, it debugged and wrote the code.\nI have no idea whether the conversion process affects anything internally, or whether it impacts output quality or prompt adherence — that is beyond my ability to evaluate. What I can tell you is that I have run it on around 20 Flux.2 Klein checkpoint merges, they all import into Draw Things successfully where before they would have failed, and the images they generate do not appear to me to have suffered from the fixing process.", "url": "https://wpnews.pro/news/fix-tensorwritesfailed-for-flux-2-klein-9b-models-in-draw-things-handles-all-fp8", "canonical_source": "https://gist.github.com/bemo-git/9c6013af9c54d44b58cb79d85c2e038a", "published_at": "2026-05-22 18:00:26+00:00", "updated_at": "2026-05-23 02:33:25.861191+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "open-source", "developer-tools", "products"], "entities": ["Draw Things", "CivitAI", "Black Forest Labs", "ComfyUI", "Flux.2 Klein", "PyTorch", "Bemo"], "alternates": {"html": "https://wpnews.pro/news/fix-tensorwritesfailed-for-flux-2-klein-9b-models-in-draw-things-handles-all-fp8", "markdown": "https://wpnews.pro/news/fix-tensorwritesfailed-for-flux-2-klein-9b-models-in-draw-things-handles-all-fp8.md", "text": "https://wpnews.pro/news/fix-tensorwritesfailed-for-flux-2-klein-9b-models-in-draw-things-handles-all-fp8.txt", "jsonld": "https://wpnews.pro/news/fix-tensorwritesfailed-for-flux-2-klein-9b-models-in-draw-things-handles-all-fp8.jsonld"}}