karlwhiteai commited on
Commit
ab6b093
·
verified ·
1 Parent(s): 95b8145

Add files using upload-large-folder tool

Browse files
ORIGINAL_README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ pipeline_tag: image-to-image
6
+ tags:
7
+ - text-to-image
8
+ - image-editing
9
+ - flux
10
+ - diffusion-single-file
11
+ ---
12
+
13
+ ![Comparison Panel](./comparison_panel.jpeg)
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
+
17
+ # **Key Features**
18
+
19
+ 1. **~1.4x faster decoding** compared to the full decoder.
20
+ 2. **~1.4x less VRAM** at decode time, enabling higher resolutions without running out of memory.
21
+ 3. **~28M decoder parameters** (vs ~50M in the full decoder) thanks to narrower channel widths (`[96, 192, 384, 384]` vs `[128, 256, 512, 512]`).
22
+ 4. **Minimal quality loss** — images are almost identical.
23
+ 5. Available under the Apache 2.0 license.
24
+
25
+ Compatible with all open FLUX.2 models:
26
+ - [FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B)
27
+ - [FLUX.2-klein-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-9B)
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
+ | ![Full Decoder](./compare_full_decoder.png) | ![Small Decoder](./compare_small_decoder.png) |
36
+
37
+ # **Usage**
38
+
39
+ ```shell
40
+ pip install git+https://github.com/huggingface/diffusers.git
41
+ ```
42
+
43
+ ```python
44
+ import torch
45
+ from diffusers import Flux2KleinPipeline, AutoencoderKLFlux2
46
+
47
+ device = "cuda"
48
+ dtype = torch.bfloat16
49
+
50
+ vae = AutoencoderKLFlux2.from_pretrained("black-forest-labs/FLUX.2-small-decoder", torch_dtype=dtype)
51
+ pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", vae=vae, torch_dtype=dtype)
52
+ pipe.enable_model_cpu_offload()
53
+
54
+ prompt = "A black cat holding a sign that says 'hello world' in typewriter font"
55
+ image = pipe(
56
+ prompt=prompt,
57
+ height=1024,
58
+ width=1024,
59
+ guidance_scale=1.0,
60
+ num_inference_steps=4,
61
+ generator=torch.Generator(device=device).manual_seed(0)
62
+ ).images[0]
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.
README.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: black-forest-labs/FLUX.2-small-decoder
4
+ tags:
5
+ - reverie
6
+ - mirror
7
+ ---
8
+
9
+ # FLUX.2-small-decoder (Reverie mirror)
10
+
11
+ An unchanged copy of files from [black-forest-labs/FLUX.2-small-decoder](https://huggingface.co/black-forest-labs/FLUX.2-small-decoder), kept here so Reverie's Mirage service downloads every model from one place. All credit belongs to the original authors. This repository is not affiliated with or endorsed by them.
12
+
13
+ ## Licence
14
+
15
+ Licensed under the original terms: `apache-2.0`. The original model card is kept as `ORIGINAL_README.md`, and any licence files from the original repository are included unchanged.
16
+
17
+ ## Files
18
+
19
+ Byte-for-byte the same as the original; checksums are in `SHA256SUMS`.
20
+
21
+ - `ORIGINAL_README.md`
22
+ - `full_encoder_small_decoder.safetensors`
SHA256SUMS ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ b8e19f407064ea4dbeaa2354d99a2bc0ccf0631fe427a4ad217663684c989b91 ORIGINAL_README.md
2
+ ea4273f02d1fafbf8e1d1c2cf6018ed8748652eb0bf34f2dd91171f16f15ab62 full_encoder_small_decoder.safetensors
3
+ 1b473340c1550b6a351e2b37ad4fc73bb9a1f3998b0172a77180d321395ab02e README.md
full_encoder_small_decoder.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea4273f02d1fafbf8e1d1c2cf6018ed8748652eb0bf34f2dd91171f16f15ab62
3
+ size 249519092