Skip to content

Commit 0d7f79b

Browse files
committed
update readme
1 parent 7d912e5 commit 0d7f79b

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# FLUX
2+
23
by Black Forest Labs: https://blackforestlabs.ai
34

45
![grid](assets/grid.jpg)
@@ -107,6 +108,22 @@ To run the demo with the dev model and create a public link:
107108
python demo_gr.py --name flux-dev --share
108109
```
109110

111+
There is also a simple FastAPI demo:
112+
113+
```bash
114+
python demo_fastapi.py --name flux-schnell --device cuda
115+
```
116+
117+
You can use the endpoint `/generate` to generate an image:
118+
119+
```bash
120+
curl --location '0.0.0.0:9000/generate' \
121+
--header 'Content-Type: application/json' \
122+
--data '{
123+
"prompt": "a cat holding a sign that says hello world"
124+
}'
125+
```
126+
110127
## Diffusers integration
111128

112129
`FLUX.1 [schnell]` and `FLUX.1 [dev]` are integrated with the [🧨 diffusers](https://github.com/huggingface/diffusers) library. To use it with diffusers, install it:
@@ -184,3 +201,7 @@ $ python -m flux.api --prompt="A beautiful beach" save outputs/api
184201
# open the image directly
185202
$ python -m flux.api --prompt="A beautiful beach" image show
186203
```
204+
205+
```
206+
207+
```

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ streamlit = [
3131
gradio = [
3232
"gradio",
3333
]
34+
fastapi = [
35+
"fastapi",
36+
]
3437
all = [
3538
"flux[streamlit]",
3639
"flux[gradio]",
40+
"flux[fastapi]",
3741
]
3842

3943
[project.scripts]

0 commit comments

Comments
 (0)