---
title: flux-3-image-klein-entropack
canonical_url: "https://www.modelscope.cn/models/DiffSynth-Studio/flux-3-image-klein-entropack"
md_url: "https://www.modelscope.cn/models/DiffSynth-Studio/flux-3-image-klein-entropack.md"
repository: DiffSynth-Studio/flux-3-image-klein-entropack
chinese_name: flux-3-image-klein-entropack
last_updated: 2026-10-16
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
parameters: 22.9B
tensor_type:
  - U8
  - BF16
  - F32
library_name:
  - safetensors
downloads: 40
stars: 0
---

# flux-3-image-klein-entropack

> flux-3-image-klein-entropack - DiffSynth-Studio 在 ModelScope 开源的模型。FLUX.3 Image Klein — EntroPack Pre-Quantized Models

- **Repository**: DiffSynth-Studio/flux-3-image-klein-entropack
- **Tasks**: text-to-image-synthesis
- **Parameters**: 22.9B
- **Downloads**: 40
- **Stars**: 0
- **Last updated**: 2026-10-16

Source: https://www.modelscope.cn/models/DiffSynth-Studio/flux-3-image-klein-entropack

---

# FLUX.3 Image Klein — EntroPack Pre-Quantized Models

We provide pre-quantized weight packages produced by [**EntroPack**](https://github.com/modelscope/entropack) for **FLUX.3 Image Klein** ([black-forest-labs/flux-3-image-klein](https://www.modelscope.cn/models/black-forest-labs/flux-3-image-klein)), which can be used with the quantization features of [**DiffSynth-Studio**](https://github.com/modelscope/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

| name | file | actual bpp | size | preview |
|---|---|---|---|---|
| dit_3bit (mixed-bit) | `models/dit_3bit.safetensors` | 3.021 | 2.10 GB | ![](assets/dit_3bit.jpg) |
| dit_4bit | `models/dit_4bit.safetensors` | 4.024 | 2.79 GB | ![](assets/dit_4bit.jpg) |
| dit_6bit | `models/dit_6bit.safetensors` | 6.053 | 4.20 GB | ![](assets/dit_6bit.jpg) |
| dit_fp8_3bit (FP8 GEMM, mixed-bit) | `models/dit_fp8_3bit.safetensors` | 3.030 | 2.10 GB | ![](assets/dit_fp8_3bit.jpg) |
| dit_fp8_4bit (FP8 GEMM) | `models/dit_fp8_4bit.safetensors` | 4.032 | 2.80 GB | ![](assets/dit_fp8_4bit.jpg) |
| dit_fp8_6bit (FP8 GEMM) | `models/dit_fp8_6bit.safetensors` | 6.049 | 4.20 GB | ![](assets/dit_fp8_6bit.jpg) |

## 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

```bash
# 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](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/flux3/model_inference/flux-3-image-klein-EntroPack.py) / [low VRAM](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/flux3/model_inference_low_vram/flux-3-image-klein-EntroPack.py)
* LoRA training: [train](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/flux3/model_training/lora/flux-3-image-klein-entropack.sh) / [validation](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/flux3/model_training/validate_lora/flux-3-image-klein-entropack.py)

`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:

```python
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/"),
)
```
