mirror of
https://www.modelscope.cn/black-forest-labs/FLUX.1-dev.git
synced 2026-04-02 16:22:53 +08:00
Add diffusers format weights (#3)
- Add diffusers format weights (5d4717a3dc82fa40a286f48bb71f1ead5c517800) - update readme with diffusers goodies (97a16425ff5c88f218d76851f32820e703ea813d) - Update README.md (9ae394376d269f108989e648378f3ee54cfe7d7b) - Upload folder using huggingface_hub (f2a94b28d7167624c443a40aaa0334351bd62c02) - update scheduler (fe1bfe0b434c9a621a4d4ddad4f57204dcf55d23) Co-authored-by: Dhruv Nair <dn6@users.noreply.huggingface.co> Co-authored-by: Apolinário from multimodal AI art <multimodalart@users.noreply.huggingface.co>
This commit is contained in:
33
README.md
33
README.md
@ -37,6 +37,39 @@ The FLUX.1 models are also available via API from the following sources
|
||||
## ComfyUI
|
||||
`FLUX.1 [dev]` is also available in [Comfy UI](https://github.com/comfyanonymous/ComfyUI) for local inference with a node-based workflow.
|
||||
|
||||
## Diffusers
|
||||
|
||||
To use `FLUX.1 [dev]` with the 🧨 diffusers python library, first install or upgrade diffusers
|
||||
|
||||
```shell
|
||||
pip install git+https://github.com/huggingface/diffusers.git
|
||||
```
|
||||
|
||||
Then you can use `FluxPipeline` to run the model
|
||||
|
||||
```python
|
||||
import torch
|
||||
from diffusers import FluxPipeline
|
||||
|
||||
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
|
||||
pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
|
||||
|
||||
prompt = "A cat holding a sign that says hello world"
|
||||
image = pipe(
|
||||
prompt,
|
||||
height=1024,
|
||||
width=1024,
|
||||
guidance_scale=3.5,
|
||||
output_type="pil",
|
||||
num_inference_steps=50,
|
||||
max_sequence_length=512,
|
||||
generator=torch.Generator("cpu").manual_seed(0)
|
||||
).images[0]
|
||||
image.save("flux-dev.png")
|
||||
```
|
||||
|
||||
To learn more check out the [diffusers](https://huggingface.co/docs/diffusers/main/en/api/pipelines/flux) documentation
|
||||
|
||||
---
|
||||
# Limitations
|
||||
- This model is not intended or able to provide factual information.
|
||||
|
||||
Reference in New Issue
Block a user