Instructions to use InsecureErasure/FLUX.2-small-decoder-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use InsecureErasure/FLUX.2-small-decoder-BF16 with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,7 +10,7 @@ tags:
|
|
| 10 |
- diffusion-single-file
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
`FLUX.2 Small Decoder` is a distilled VAE decoder that serves as a **drop-in replacement** for the standard FLUX.2 decoder. It delivers faster decoding and lower VRAM usage with minimal to zero quality loss. The encoder remains unchanged.
|
| 16 |
|
|
@@ -28,12 +28,6 @@ Compatible with all open FLUX.2 models:
|
|
| 28 |
- [FLUX.2-klein-9b-kv](https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-kv)
|
| 29 |
- [FLUX.2-dev](https://huggingface.co/black-forest-labs/FLUX.2-dev)
|
| 30 |
|
| 31 |
-
# **Comparison**
|
| 32 |
-
|
| 33 |
-
| Full Decoder | Small Decoder |
|
| 34 |
-
|:---:|:---:|
|
| 35 |
-
|  |  |
|
| 36 |
-
|
| 37 |
# **Usage**
|
| 38 |
|
| 39 |
```shell
|
|
@@ -47,7 +41,7 @@ from diffusers import Flux2KleinPipeline, AutoencoderKLFlux2
|
|
| 47 |
device = "cuda"
|
| 48 |
dtype = torch.bfloat16
|
| 49 |
|
| 50 |
-
vae = AutoencoderKLFlux2.from_pretrained("
|
| 51 |
pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", vae=vae, torch_dtype=dtype)
|
| 52 |
pipe.enable_model_cpu_offload()
|
| 53 |
|
|
@@ -63,34 +57,7 @@ image = pipe(
|
|
| 63 |
image.save("flux-klein-small-decoder.png")
|
| 64 |
```
|
| 65 |
|
| 66 |
-
|
| 67 |
-
---
|
| 68 |
-
# Limitations
|
| 69 |
-
|
| 70 |
-
- This model is not intended or able to provide factual information.
|
| 71 |
-
- While the model can output text, text rendered may be inaccurate or subject to distortion.
|
| 72 |
-
- As a statistical model, this checkpoint may represent or amplify biases observed in the training data.
|
| 73 |
-
- The model may fail to generate output that matches the prompts.
|
| 74 |
-
- Prompt following is heavily influenced by the prompting style.
|
| 75 |
-
|
| 76 |
-
# Out-of-Scope Use
|
| 77 |
-
|
| 78 |
-
This model and its derivatives may not be used outside the scope of the license, including for unlawful, fraudulent, defamatory, abusive, or otherwise violative purposes as further explained in our Usage Policies.
|
| 79 |
-
|
| 80 |
---
|
| 81 |
-
# Responsible AI Development
|
| 82 |
-
|
| 83 |
-
Black Forest Labs is committed to responsible model development and deployment. Prior to releasing FLUX.2 [klein] 9B-KV, we evaluated and mitigated a number of risks, including child sexual abuse material (CSAM) and nonconsensual intimate imagery (NCII). For detailed information about our mitigations, evaluation processes, content provenance features, and policies, please see our post: [Capable, Open, and Safe: Combating AI
|
| 84 |
-
Misuse](https://bfl.ai/blog/capable-open-and-safe-combating-ai-misuse).
|
| 85 |
-
|
| 86 |
-
To report safety concerns, contact safety@blackforestlabs.ai.
|
| 87 |
-
|
| 88 |
-
---
|
| 89 |
-
|
| 90 |
# License
|
| 91 |
|
| 92 |
-
This model is licensed under the https://www.apache.org/licenses/LICENSE-2.0.
|
| 93 |
-
|
| 94 |
-
# Trademarks & IP
|
| 95 |
-
|
| 96 |
-
This project may contain trademarks or logos for projects, products, or services. Use of Black Forest Labs and FLUX trademarks or logos in modified versions of this project must not cause confusion or imply sponsorship or endorsement. Any use of third-party trademarks, intellectual property or logos are subject to those third-party's policies.
|
|
|
|
| 10 |
- diffusion-single-file
|
| 11 |
---
|
| 12 |
|
| 13 |
+
This is a BF16 conversion of [`black-forest-labs/FLUX.2-small-decoder`](https://huggingface.co/black-forest-labs/FLUX.2-small-decoder), converted using `diffusers` and `safetensors`. Weights cast from FP32 to BF16; `bn` statistics preserved as-is.
|
| 14 |
|
| 15 |
`FLUX.2 Small Decoder` is a distilled VAE decoder that serves as a **drop-in replacement** for the standard FLUX.2 decoder. It delivers faster decoding and lower VRAM usage with minimal to zero quality loss. The encoder remains unchanged.
|
| 16 |
|
|
|
|
| 28 |
- [FLUX.2-klein-9b-kv](https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-kv)
|
| 29 |
- [FLUX.2-dev](https://huggingface.co/black-forest-labs/FLUX.2-dev)
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
# **Usage**
|
| 32 |
|
| 33 |
```shell
|
|
|
|
| 41 |
device = "cuda"
|
| 42 |
dtype = torch.bfloat16
|
| 43 |
|
| 44 |
+
vae = AutoencoderKLFlux2.from_pretrained("InsecureErasure/FLUX.2-small-decoder-BF16", torch_dtype=dtype)
|
| 45 |
pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", vae=vae, torch_dtype=dtype)
|
| 46 |
pipe.enable_model_cpu_offload()
|
| 47 |
|
|
|
|
| 57 |
image.save("flux-klein-small-decoder.png")
|
| 58 |
```
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
# License
|
| 62 |
|
| 63 |
+
This model is licensed under the https://www.apache.org/licenses/LICENSE-2.0.
|
|
|
|
|
|
|
|
|
|
|
|