YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
FLUX.3 Image Klein β EntroPack Pre-Quantized Models
We provide pre-quantized weight packages produced by EntroPack for FLUX.3 Image Klein (black-forest-labs/flux-3-image-klein), which can be used with the quantization features of DiffSynth-Studio.
Both the DiT and the text encoder are provided at three compression rates (3 / 4 / 6 bit), and the DiT additionally ships FP8 GEMM variants:
3bit(lowest VRAM) β mixed-bit: the most sensitive layers (embeddings, time / modulation and final layers, 15 layers) keep 4.0 bpp, while the remaining 258 layers use 2.9482 bpp (weighted target 3.0 bpp);4bit(balanced) β uniform entropy coding at 4 bits per weight;6bit(highest precision) β uniform entropy coding at 6 bits per weight; the accuracy is close to FP8 quantization;fp8_3bit/fp8_4bit/fp8_6bit(DiT only) β weights are first FP8 W8A8-quantized, then entropy-coded by EntroPack down to 3 / 4 / 6-bit storage; the forward pass uses FP8 GEMM for faster inference.
All packages are entropy-coded from the original BF16 weights directly. Every *.safetensors ships with a same-named *.json that records its quantization config. actual bpp = 8 Γ Ξ£ storage bytes / Ξ£ numel is measured on the package artifacts.
DiT
Text Encoder
| name | file | actual bpp | size |
|---|---|---|---|
| text_encoder_3bit | models/text_encoder_3bit.safetensors |
3.023 | 2.46 GB |
| text_encoder_4bit | models/text_encoder_4bit.safetensors |
4.027 | 3.02 GB |
| text_encoder_6bit | models/text_encoder_6bit.safetensors |
6.058 | 4.14 GB |
Usage
Install
# DiffSynth-Studio
git clone https://github.com/modelscope/DiffSynth-Studio.git
cd DiffSynth-Studio && pip install -e .
# EntroPack (pick the extra matching your CUDA version: cuda13 / cuda12)
git clone https://github.com/modelscope/entropack.git
cd entropack && pip install -e '.[cuda13]'
Example scripts
- Inference: standard / low VRAM
- LoRA training: train / validation
dit_package and text_encoder_package are chosen independently: any combination works (e.g. dit_fp8_6bit with text_encoder_4bit). dit_4bit and text_encoder_4bit are pre-registered in DiffSynth-Studio, so they load with a plain ModelConfig; the helper below registers any package's json sidecar before loading:
import json
from diffsynth.configs import MODEL_CONFIGS
from diffsynth.pipelines.flux3_image import Flux3ImagePipeline, ModelConfig
prequant_model_id = "DiffSynth-Studio/flux-3-image-klein-entropack"
dit_package = "models/dit_4bit.safetensors"
text_encoder_package = "models/text_encoder_4bit.safetensors"
def make_package(pattern):
package = ModelConfig(model_id=prequant_model_id, origin_file_pattern=pattern)
package.download_if_necessary()
sidecar = ModelConfig(model_id=prequant_model_id, origin_file_pattern=pattern.replace(".safetensors", ".json"))
sidecar.download_if_necessary()
with open(sidecar.path) as handle:
entry = json.load(handle)
if not any(config.get("model_hash") == entry["model_hash"] for config in MODEL_CONFIGS):
MODEL_CONFIGS.append(entry)
return package
pipe = Flux3ImagePipeline.from_pretrained(
torch_dtype=torch.bfloat16,
device="cuda",
model_configs=[
make_package(dit_package),
make_package(text_encoder_package),
ModelConfig(model_id="black-forest-labs/flux-3-image-klein", origin_file_pattern="vae/diffusion_pytorch_model.safetensors"),
],
processor_config=ModelConfig(model_id="black-forest-labs/flux-3-image-klein", origin_file_pattern="text_encoder/"),
)





