extract-textencoder extracts the embedding and first 30 transformer layers
from a compatible Hugging Face Mistral Small 3.2 24B checkpoint and packages
them as a standalone FLUX.2 text encoder for ComfyUI.
This is intentionally not a universal LLM converter. The first release only
supports full checkpoints derived from
mistralai/Mistral-Small-3.2-24B-Instruct-2506 that retain its architecture,
tokenizer, and Hugging Face tensor layout.
Use uv for environment and package management:
uv sync
uv run extract-textencoder --helpNo lockfile is committed yet because this repository was prepared under a
static-only constraint. Run uv lock on the machine that will perform the
conversion if a reproducible environment is required.
uv run extract-textencoder convert \
--repo-id huihui-ai/Huihui-Mistral-Small-3.2-24B-Instruct-2506-abliterated \
--revision COMMIT_HASH \
--output mistral_3_small_flux2_huihui_bf16.safetensorsThe normal Hugging Face credential sources are honored, including HF_TOKEN
and credentials saved by hf auth login.
The directory must contain config.json, tekken.json,
model.safetensors.index.json, and all referenced shard files.
uv run extract-textencoder convert \
--local-dir /mnt/models/mistral-small-snapshot \
--output /mnt/models/mistral_3_small_flux2_bf16.safetensorsExisting output files are protected by default. Pass --overwrite only when
replacement is intended. BF16 is required by default; --allow-non-bf16
preserves floating-point source dtypes and does not quantize them.
uv run extract-textencoder inspect mistral_3_small_flux2_bf16.safetensorsThe inspector checks tensor names, shapes, dtypes, layer coverage, tokenizer packaging, and forbidden weights without loading or running the transformer.
For design details, see extract.md. After conversion, configure
test_extracted.toml and run the standalone end-to-end
test described in test_extracted.md.