Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- README.md +90 -0
- metadata.json +13 -0
- text_encoder/flux1_mlx_model.safetensors +3 -0
- text_encoder_2/flux1_mlx_model-00001-of-00002.safetensors +3 -0
- text_encoder_2/flux1_mlx_model-00002-of-00002.safetensors +3 -0
- transformer/flux1_mlx_model-00001-of-00004.safetensors +3 -0
- transformer/flux1_mlx_model-00002-of-00004.safetensors +3 -0
- transformer/flux1_mlx_model-00003-of-00004.safetensors +3 -0
- transformer/flux1_mlx_model-00004-of-00004.safetensors +3 -0
- vae/flux1_mlx_model.safetensors +3 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: mlx
|
| 3 |
+
tags:
|
| 4 |
+
- mlx
|
| 5 |
+
- flux
|
| 6 |
+
- text-to-image
|
| 7 |
+
- quantized
|
| 8 |
+
- swift
|
| 9 |
+
pipeline_tag: text-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-dev 4-bit Quantized for MLX
|
| 16 |
+
|
| 17 |
+
This is a 4-bit quantized version of the FLUX.1-dev model optimized for use with MLX and flux.swift. The model size has been reduced from ~24GB to 9.2GB while maintaining excellent 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**: 4-bit with group size 64
|
| 23 |
+
- **Total Size**: 9.2GB
|
| 24 |
+
- **Original Model**: [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-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
|
| 35 |
+
flux.swift.cli \
|
| 36 |
+
--load-quantized-path /path/to/this/model \
|
| 37 |
+
--hf-token YOUR_HF_TOKEN \
|
| 38 |
+
--prompt "Your prompt here" \
|
| 39 |
+
--output output.png
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
### Recommended Parameters
|
| 43 |
+
- **Steps**: 10+ (for quality)
|
| 44 |
+
- **Guidance Scale**: 7.5
|
| 45 |
+
- **Authentication**: Requires Hugging Face token
|
| 46 |
+
- **Use Case**: High-quality generation
|
| 47 |
+
|
| 48 |
+
### Example with Parameters
|
| 49 |
+
```bash
|
| 50 |
+
flux.swift.cli \
|
| 51 |
+
--load-quantized-path /path/to/this/model \
|
| 52 |
+
--hf-token YOUR_HF_TOKEN \
|
| 53 |
+
--prompt "A futuristic robot in a cyberpunk city" \
|
| 54 |
+
--steps 20 \
|
| 55 |
+
--guidance 7.5 \
|
| 56 |
+
--width 768 \
|
| 57 |
+
--height 768 \
|
| 58 |
+
--seed 42 \
|
| 59 |
+
--output cyberpunk_robot.png
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## License
|
| 63 |
+
|
| 64 |
+
This model is a quantized version of FLUX.1-dev, which is licensed under the FLUX.1 [dev] Non-Commercial License. Please review the original license terms:
|
| 65 |
+
- Original model: https://huggingface.co/black-forest-labs/FLUX.1-dev
|
| 66 |
+
- License: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
|
| 67 |
+
- Commercial licensing available at: https://bfl.ai/pricing/licensing
|
| 68 |
+
|
| 69 |
+
## Performance
|
| 70 |
+
- **Memory Usage**: Reduced from ~24GB to 9.2GB
|
| 71 |
+
- **Quality**: Excellent preservation of generation quality
|
| 72 |
+
- **Platform**: Optimized for Apple Silicon Macs
|
| 73 |
+
|
| 74 |
+
## Citation
|
| 75 |
+
```bibtex
|
| 76 |
+
@misc{flux-dev,
|
| 77 |
+
author = {Black Forest Labs},
|
| 78 |
+
title = {FLUX.1-dev},
|
| 79 |
+
publisher = {Black Forest Labs},
|
| 80 |
+
year = {2024},
|
| 81 |
+
url = {https://huggingface.co/black-forest-labs/FLUX.1-dev}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
@software{flux-swift,
|
| 85 |
+
author = {mzbac},
|
| 86 |
+
title = {flux.swift: Swift implementation of FLUX models},
|
| 87 |
+
url = {https://github.com/mzbac/flux.swift},
|
| 88 |
+
year = {2024}
|
| 89 |
+
}
|
| 90 |
+
```
|
metadata.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"quantizationBits" : 4,
|
| 3 |
+
"groupSize" : 64,
|
| 4 |
+
"components" : [
|
| 5 |
+
"vae",
|
| 6 |
+
"transformer",
|
| 7 |
+
"text_encoder",
|
| 8 |
+
"text_encoder_2"
|
| 9 |
+
],
|
| 10 |
+
"createdAt" : "2025-07-03T13:51:34Z",
|
| 11 |
+
"modelType" : "FluxPipeline",
|
| 12 |
+
"fluxSwiftVersion" : "1.0.0"
|
| 13 |
+
}
|
text_encoder/flux1_mlx_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6aacaa41217fb473fd386476131a68a903129b3c22cbdf5dd89bbfd338f53cf5
|
| 3 |
+
size 124067711
|
text_encoder_2/flux1_mlx_model-00001-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:281a23db7c97bacd050c3396f85550b217599043c58dd40461a0d1b523fda042
|
| 3 |
+
size 1991601891
|
text_encoder_2/flux1_mlx_model-00002-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:428596c1571f0ff17d9204fb8af3111a497f6a63b5fd02f019952b04cc4da17b
|
| 3 |
+
size 876731976
|
transformer/flux1_mlx_model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8e3f9649f0c2c2f07c4a9ec84529a4dd66e8f3932a2275afc83cf8912b5d84a
|
| 3 |
+
size 1983712614
|
transformer/flux1_mlx_model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33ec8041e3905f65b01489023bdf61516edd8aad53c1da9a488b632ad16da327
|
| 3 |
+
size 1973493554
|
transformer/flux1_mlx_model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41f5dabef34825f3b522977bdca263ddb4cb7121845ba790289c035e8253a23d
|
| 3 |
+
size 1997990862
|
transformer/flux1_mlx_model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8efb1ca55ce68c58979de614f4f384007838d59dba3399ad7c79b7ce9383a264
|
| 3 |
+
size 744319372
|
vae/flux1_mlx_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c5108f0185125c4bb74eff7e1385ebde227ae062133a4858dffd7091e4aa4078
|
| 3 |
+
size 164654295
|