dverdu-freepik
commited on
Commit
•
c0f6c18
1
Parent(s):
ae04fe7
Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,71 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: flux-1-dev-non-commercial-license
|
4 |
+
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/LICENSE.md
|
5 |
+
base_model:
|
6 |
+
- black-forest-labs/FLUX.1-dev
|
7 |
+
pipeline_tag: text-to-image
|
8 |
+
library_name: diffusers
|
9 |
+
tags:
|
10 |
+
- flux
|
11 |
+
- text-to-image
|
12 |
+
---
|
13 |
+
|
14 |
+
# Flux.1 Lite
|
15 |
+
We want to announce the alpha version of our new distilled Flux.1 Lite model, an 8B parameter transformer model distilled from the original Flux1. dev model.
|
16 |
+
|
17 |
+
Our goal is to further reduce FLUX.1-dev transformer parameters up to 24Gb to make it compatible with most of GPU cards.
|
18 |
+
|
19 |
+
![](./flux1-lite-8B_tearser.jpg)
|
20 |
+
|
21 |
+
|
22 |
+
## News🔥🔥🔥
|
23 |
+
* Oct.18, 2024. Alpha 8B checkpoint and comparison demo 🤗 (i.e. [Flux.1 Lite](https://huggingface.co/spaces/Freepik/flux.1-lite)) is publicly available on [HuggingFace Repo](https://huggingface.co/Freepik/flux.1-lite-8B-alpha).
|
24 |
+
|
25 |
+
## Try our Hugging Face demos:
|
26 |
+
Flux.1 Lite demo host on [🤗 flux.1-lite](https://huggingface.co/spaces/Freepik/flux.1-lite)
|
27 |
+
|
28 |
+
## Introduction
|
29 |
+
|
30 |
+
Hyper-SD is one of the new State-of-the-Art diffusion model acceleration techniques.
|
31 |
+
In this repository, we release the models distilled from [FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev), [SD3-Medium](https://huggingface.co/stabilityai/stable-diffusion-3-medium-diffusers), [SDXL Base 1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) and [Stable-Diffusion v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5)。
|
32 |
+
|
33 |
+
## Checkpoints
|
34 |
+
|
35 |
+
* `flux.1-lite-8B-alpha.safetensors`: Transformer checkpoint, in Flux original format.
|
36 |
+
|
37 |
+
## Text-to-Image Usage
|
38 |
+
|
39 |
+
### FLUX.1-dev-related models
|
40 |
+
```python
|
41 |
+
import torch
|
42 |
+
from diffusers import FluxPipeline
|
43 |
+
|
44 |
+
base_model_id = "Freepik/flux.1-lite-8B-alpha"
|
45 |
+
torch_dtype = torch.bfloat16
|
46 |
+
device = "cuda"
|
47 |
+
|
48 |
+
# Load the pipe
|
49 |
+
model_id = "Freepik/flux.1-lite-8B-alpha"
|
50 |
+
pipe = FluxPipeline.from_pretrained(
|
51 |
+
model_id, torch_dtype=torch_dtype
|
52 |
+
).to(device)
|
53 |
+
|
54 |
+
# Inference
|
55 |
+
prompt = " scene inspired by 2000 comedy animation, a glowing green alien whose fluorescent skin emits light, standing in a dark purple forest. The alien is holding a large sign that reads "LITE 8B ALPHA" in bold letters. The forest around is shadowy, with tall, eerie trees and mist rolling in. The alien radiates a soft, supernatural glow, illuminating the surroundings, creating a stark contrast between light and darkness. Style of an old comic, with flat colors, halftone shading, and a slightly weathered, vintage texture."
|
56 |
+
|
57 |
+
guidance_scale = 3.5 # Important to keep guidance_scale to 3.5
|
58 |
+
n_steps = 24
|
59 |
+
seed = 12
|
60 |
+
|
61 |
+
with torch.inference_mode():
|
62 |
+
image = pipe(
|
63 |
+
prompt=prompt,
|
64 |
+
generator=torch.Generator(device="cuda").manual_seed(seed),
|
65 |
+
num_inference_steps=n_steps,
|
66 |
+
guidance_scale=guidance_scale,
|
67 |
+
height=1024,
|
68 |
+
width=1024,
|
69 |
+
).images[0]
|
70 |
+
image.save("output.png")
|
71 |
+
```
|