Copy black-forest-labs original README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,81 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
license: apache-2.0
|
5 |
+
tags:
|
6 |
+
- text-to-image
|
7 |
+
- image-generation
|
8 |
+
- flux
|
9 |
+
---
|
10 |
+
|
11 |
+
![FLUX.1 [schnell] Grid](./schnell_grid.jpeg)
|
12 |
+
|
13 |
+
`FLUX.1 [schnell]` is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions.
|
14 |
+
For more information, please read our [blog post](https://blackforestlabs.ai/announcing-black-forest-labs/).
|
15 |
+
|
16 |
+
# Key Features
|
17 |
+
1. Cutting-edge output quality and competitive prompt following, matching the performance of closed source alternatives.
|
18 |
+
2. Trained using latent adversarial diffusion distillation, `FLUX.1 [schnell]` can generate high-quality images in only 1 to 4 steps.
|
19 |
+
3. Released under the `apache-2.0` licence, the model can be used for personal, scientific, and commercial purposes.
|
20 |
+
|
21 |
+
# Usage
|
22 |
+
We provide a reference implementation of `FLUX.1 [schnell]`, as well as sampling code, in a dedicated [github repository](https://github.com/black-forest-labs/flux).
|
23 |
+
Developers and creatives looking to build on top of `FLUX.1 [schnell]` are encouraged to use this as a starting point.
|
24 |
+
|
25 |
+
## API Endpoints
|
26 |
+
The FLUX.1 models are also available via API from the following sources
|
27 |
+
- [bfl.ml](https://docs.bfl.ml/) (currently `FLUX.1 [pro]`)
|
28 |
+
- [replicate.com](https://replicate.com/collections/flux)
|
29 |
+
- [fal.ai](https://fal.ai/models/fal-ai/flux/schnell)
|
30 |
+
- [mystic.ai](https://www.mystic.ai/black-forest-labs/flux1-schnell)
|
31 |
+
|
32 |
+
## ComfyUI
|
33 |
+
`FLUX.1 [schnell]` is also available in [Comfy UI](https://github.com/comfyanonymous/ComfyUI) for local inference with a node-based workflow.
|
34 |
+
|
35 |
+
## Diffusers
|
36 |
+
To use `FLUX.1 [schnell]` with the 🧨 diffusers python library, first install or upgrade diffusers
|
37 |
+
|
38 |
+
```shell
|
39 |
+
pip install -U diffusers
|
40 |
+
```
|
41 |
+
|
42 |
+
Then you can use `FluxPipeline` to run the model
|
43 |
+
|
44 |
+
```python
|
45 |
+
import torch
|
46 |
+
from diffusers import FluxPipeline
|
47 |
+
|
48 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16)
|
49 |
+
pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
|
50 |
+
|
51 |
+
prompt = "A cat holding a sign that says hello world"
|
52 |
+
image = pipe(
|
53 |
+
prompt,
|
54 |
+
guidance_scale=0.0,
|
55 |
+
num_inference_steps=4,
|
56 |
+
max_sequence_length=256,
|
57 |
+
generator=torch.Generator("cpu").manual_seed(0)
|
58 |
+
).images[0]
|
59 |
+
image.save("flux-schnell.png")
|
60 |
+
```
|
61 |
+
|
62 |
+
To learn more check out the [diffusers](https://huggingface.co/docs/diffusers/main/en/api/pipelines/flux) documentation
|
63 |
+
|
64 |
+
---
|
65 |
+
# Limitations
|
66 |
+
- This model is not intended or able to provide factual information.
|
67 |
+
- As a statistical model this checkpoint might amplify existing societal biases.
|
68 |
+
- The model may fail to generate output that matches the prompts.
|
69 |
+
- Prompt following is heavily influenced by the prompting-style.
|
70 |
+
|
71 |
+
# Out-of-Scope Use
|
72 |
+
The model and its derivatives may not be used
|
73 |
+
|
74 |
+
- In any way that violates any applicable national, federal, state, local or international law or regulation.
|
75 |
+
- For the purpose of exploiting, harming or attempting to exploit or harm minors in any way; including but not limited to the solicitation, creation, acquisition, or dissemination of child exploitative content.
|
76 |
+
- To generate or disseminate verifiably false information and/or content with the purpose of harming others.
|
77 |
+
- To generate or disseminate personal identifiable information that can be used to harm an individual.
|
78 |
+
- To harass, abuse, threaten, stalk, or bully individuals or groups of individuals.
|
79 |
+
- To create non-consensual nudity or illegal pornographic content.
|
80 |
+
- For fully automated decision making that adversely impacts an individual's legal rights or otherwise creates or modifies a binding, enforceable obligation.
|
81 |
+
- Generating or facilitating large-scale disinformation campaigns.
|