Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# flux_quantized_half
|
| 2 |
+
|
| 3 |
+
## Model Overview
|
| 4 |
+
|
| 5 |
+
`Silan10/flux_quantized_half` is a **half-precision (FP16) variant** of the
|
| 6 |
+
[`black-forest-labs/FLUX.1-dev`](https://huggingface.co/black-forest-labs/FLUX.1-dev)
|
| 7 |
+
text-to-image model.
|
| 8 |
+
|
| 9 |
+
This repository only changes the **numerical precision of the weights** to
|
| 10 |
+
`torch.float16` using PyTorch.
|
| 11 |
+
|
| 12 |
+
- **Base model:** `black-forest-labs/FLUX.1-dev`
|
| 13 |
+
- **Precision:** FP16 (`torch.float16`)
|
| 14 |
+
|
| 15 |
+
## Usage (Diffusers)
|
| 16 |
+
|
| 17 |
+
```python
|
| 18 |
+
import torch
|
| 19 |
+
from diffusers import FluxPipeline
|
| 20 |
+
|
| 21 |
+
pipe = FluxPipeline.from_pretrained(
|
| 22 |
+
"Silan10/flux_quantized_half"
|
| 23 |
+
)
|
| 24 |
+
pipe.to("cuda") # or pipe.enable_model_cpu_offload() for low VRAM
|
| 25 |
+
|
| 26 |
+
prompt = "A detailed concept art of a futuristic city at sunset"
|
| 27 |
+
image = pipe(
|
| 28 |
+
prompt,
|
| 29 |
+
guidance_scale=3.5,
|
| 30 |
+
num_inference_steps=20,
|
| 31 |
+
max_sequence_length=256,
|
| 32 |
+
).images[0]
|
| 33 |
+
|
| 34 |
+
image.save("flux_half_sample.png")
|