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
- Local Apps Settings
- Draw Things
- DiffusionBee
TypeError: expected str, bytes or os.PathLike object, not NoneType
#105
by yangxiaoze - opened
TypeError: expected str, bytes or os.PathLike object, not NoneType
same on Windows 11
I had to downgrade to numpy <2 and then got this error TypeError: expected str, bytes or os.PathLike object, not NoneType
with this small code example:
from diffusers import FluxPipeline
from huggingface_hub import login
login(token="xxxx")
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, # 1024
width=1024, # 1024
guidance_scale=3.5,
num_inference_steps=50,
max_sequence_length=512,
generator=torch.Generator("cpu").manual_seed(0)
).images[0]
image.save("flux-dev.png")```
did you find a fix?
i think cuda 11 was the issu for me, i went cuda 12 and its working now