Instructions to use black-forest-labs/FLUX.1-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use black-forest-labs/FLUX.1-dev with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
- Local Apps Settings
- Draw Things
- DiffusionBee
unexpected keyword argument 'strict'
hi, i have this issue:
/.local/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 774, in from_pretrained
accelerate.load_checkpoint_and_dispatch(
TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'strict'
code:
import torch
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained("/path/flux1-dev", torch_dtype=torch.bfloat16)
prompt = "A cat holding a sign that says something"
image = pipe(
prompt,
height=1024,
width=1024,
guidance_scale=3.5,
num_inference_steps=50,
max_sequence_length=512,
generator=torch.Generator(device='cuda').manual_seed(0)
).images[0]
image.save("image.png")
any idea why? i am trying to load it to cuda
Same issue, using model card code.
pip install accelerate -U helps for me.
It fixed for me after creating new python virtualenv and installing dependencies.