mzbac commited on
Commit
1f98fe5
·
verified ·
1 Parent(s): 5855a61

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: mlx
3
+ tags:
4
+ - mlx
5
+ - flux
6
+ - image-to-image
7
+ - quantized
8
+ - swift
9
+ pipeline_tag: image-to-image
10
+ license: other
11
+ license_name: flux-1-dev-non-commercial-license
12
+ license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
13
+ ---
14
+
15
+ # FLUX.1-Kontext 8-bit Quantized for MLX
16
+
17
+ This is an 8-bit quantized version of the FLUX.1-Kontext-dev model optimized for use with MLX and flux.swift. The model size has been reduced from ~24GB to 17GB while maintaining excellent image-to-image generation quality.
18
+
19
+ Quantized using [flux.swift](https://github.com/mzbac/flux.swift), a Swift implementation of FLUX models for Apple Silicon.
20
+
21
+ ## Model Details
22
+ - **Quantization**: 8-bit with group size 128
23
+ - **Total Size**: 17GB
24
+ - **Original Model**: [black-forest-labs/FLUX.1-Kontext-dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev)
25
+ - **Framework**: MLX (Metal Performance Shaders)
26
+ - **Components**: Transformer, VAE, CLIP text encoder, T5 text encoder
27
+
28
+ ## Usage
29
+
30
+ This model requires the [flux.swift](https://github.com/mzbac/flux.swift) implementation. Please refer to the repository for installation and usage instructions.
31
+
32
+ ### Quick Start
33
+ ```bash
34
+ # Load and use the quantized model for image-to-image generation
35
+ flux.swift.cli \
36
+ --load-quantized-path /path/to/this/model \
37
+ --hf-token YOUR_HF_TOKEN \
38
+ --init-image-path /path/to/input/image.png \
39
+ --prompt "Your transformation prompt here" \
40
+ --output output.png
41
+ ```
42
+
43
+ ### Recommended Parameters
44
+ - **Steps**: 30
45
+ - **Guidance Scale**: 3.5
46
+ - **Authentication**: Requires Hugging Face token
47
+ - **Input**: Requires `--init-image-path` for image-to-image generation
48
+
49
+ ### Example with Parameters
50
+ ```bash
51
+ flux.swift.cli \
52
+ --load-quantized-path /path/to/this/model \
53
+ --hf-token YOUR_HF_TOKEN \
54
+ --init-image-path ./reference.png \
55
+ --prompt "transform this into a watercolor painting with soft pastel tones" \
56
+ --steps 30 \
57
+ --guidance 3.5 \
58
+ --width 512 \
59
+ --height 512 \
60
+ --seed 42 \
61
+ --output watercolor_painting.png
62
+ ```
63
+
64
+ ## License
65
+
66
+ This model is a quantized version of FLUX.1-Kontext-dev, which is licensed under the FLUX.1 [dev] Non-Commercial License. Please review the original license terms:
67
+ - Original model: https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev
68
+ - License: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
69
+ - Commercial licensing available at: https://bfl.ai/pricing/licensing
70
+
71
+ ## Performance
72
+ - **Memory Usage**: Reduced from ~24GB to 17GB
73
+ - **Quality**: Excellent preservation of image-to-image generation quality
74
+ - **Platform**: Optimized for Apple Silicon Macs
75
+
76
+ ## Citation
77
+ ```bibtex
78
+ @misc{flux-kontext,
79
+ author = {Black Forest Labs},
80
+ title = {FLUX.1-Kontext-dev},
81
+ publisher = {Black Forest Labs},
82
+ year = {2024},
83
+ url = {https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev}
84
+ }
85
+
86
+ @software{flux-swift,
87
+ author = {mzbac},
88
+ title = {flux.swift: Swift implementation of FLUX models},
89
+ url = {https://github.com/mzbac/flux.swift},
90
+ year = {2024}
91
+ }
92
+ ```
metadata.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "quantizationBits" : 8,
3
+ "fluxSwiftVersion" : "1.0.0",
4
+ "components" : [
5
+ "vae",
6
+ "transformer",
7
+ "text_encoder",
8
+ "text_encoder_2"
9
+ ],
10
+ "groupSize" : 128,
11
+ "createdAt" : "2025-07-04T08:44:14Z",
12
+ "modelType" : "FluxKontextPipeline"
13
+ }
text_encoder/flux1_mlx_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f3f7d7e6295e33fbcba9c022bc2e546513f7c4cb494182ba79644cecbfab6ec
3
+ size 156558962
text_encoder_2/flux1_mlx_model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfc2397f07370e6fd353cae0526c1641aad88679311323b9bb250f6ed49ce58c
3
+ size 1989865378
text_encoder_2/flux1_mlx_model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b36d5b759bb6a3b1a04368a7e20af9e629e94934021b84dbe6159bb048543a8
3
+ size 1989865616
text_encoder_2/flux1_mlx_model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c9ebc8e5945f26ed1b02ebf31690f5a776c01a7f5e07a8d314265574acd4278
3
+ size 1059151461
transformer/flux1_mlx_model-00001-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5798db852139803a8f393aea9cd4b369fdd127f92a5771a4c519360faa40504
3
+ size 1989779434
transformer/flux1_mlx_model-00002-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35a77d61d360170cedb9f1bf80e00c66f8bafd1f46119f9eb598e37a2de62ab2
3
+ size 1996044782
transformer/flux1_mlx_model-00003-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12655fdbfc61e6fd25f7c25883119efc3b47525fd588f67a8b21dcb80d43a607
3
+ size 2000002438
transformer/flux1_mlx_model-00004-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c08b02bfe320964b0e22d72ef9800483aef5db592e0ee3fc9c87fad0b283695
3
+ size 1967103412
transformer/flux1_mlx_model-00005-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f50c7bcae4d3841be2fc763409b166703e12b5e5157cef841944d87a93d3c73
3
+ size 1986463616
transformer/flux1_mlx_model-00006-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14425fa21066f808b17ce54ac9adc5c6fc58f706aa69459a8e9b0b20c5b52a48
3
+ size 1996161451
transformer/flux1_mlx_model-00007-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc3dd927949fff289d06b205b88ada550cb13765caaa2274441b642e32846672
3
+ size 341208858
vae/flux1_mlx_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:103bc809047376a54df6b39479ca7ee6983eac6132c74def1168805731e6a965
3
+ size 165637256