Feature Extraction
Transformers
Safetensors
Diffusers
English
qwen3
flux
text-encoder
pruning
distillation
Instructions to use SearchingMan/FLUX.2-klein-9B-Text-Encoder-Pruned-5.1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SearchingMan/FLUX.2-klein-9B-Text-Encoder-Pruned-5.1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="SearchingMan/FLUX.2-klein-9B-Text-Encoder-Pruned-5.1B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("SearchingMan/FLUX.2-klein-9B-Text-Encoder-Pruned-5.1B") model = AutoModel.from_pretrained("SearchingMan/FLUX.2-klein-9B-Text-Encoder-Pruned-5.1B", device_map="auto") - Diffusers
How to use SearchingMan/FLUX.2-klein-9B-Text-Encoder-Pruned-5.1B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("SearchingMan/FLUX.2-klein-9B-Text-Encoder-Pruned-5.1B", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Quick Start: gated-base prerequisite note; clarify total download is unchanged vs base
Browse files
README.md
CHANGED
|
@@ -152,6 +152,12 @@ Measured on an RTX 5090 (24 GB), torch 2.11 / cu128, 512-token encodes, batch 4:
|
|
| 152 |
|
| 153 |
## Quick Start
|
| 154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
The encoder has mixed per-layer FFN/attention widths, which a stock Qwen3 config cannot
|
| 156 |
express — load it through the bundled `loading.py` (plain file, no `trust_remote_code`):
|
| 157 |
|
|
|
|
| 152 |
|
| 153 |
## Quick Start
|
| 154 |
|
| 155 |
+
> **Prerequisite:** the DiT/VAE/tokenizer come from the gated base repo — accept the
|
| 156 |
+
> license at [black-forest-labs/FLUX.2-klein-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-9B)
|
| 157 |
+
> and `hf auth login` once. This repo only replaces the text encoder, so you never
|
| 158 |
+
> download the original 14 GiB encoder — total download is the same as the base
|
| 159 |
+
> pipeline alone (~27 GiB), and less if you already have klein cached.
|
| 160 |
+
|
| 161 |
The encoder has mixed per-layer FFN/attention widths, which a stock Qwen3 config cannot
|
| 162 |
express — load it through the bundled `loading.py` (plain file, no `trust_remote_code`):
|
| 163 |
|