Instructions to use black-forest-labs/FLUX.1-Fill-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-Fill-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-Fill-dev", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Diffusion Single File
How to use black-forest-labs/FLUX.1-Fill-dev with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
copying a param with shape torch.Size([3072, 384]) from checkpoint, the shape in current model is torch.Size([3072, 64]).
Traceback (most recent call last):
File "E:\loratrain\lora-scripts-v1.10.0\scripts\dev\flux_train_network.py", line 588, in
trainer.train(args)
File "E:\loratrain\lora-scripts-v1.10.0\scripts\dev\train_network.py", line 529, in train
model_version, text_encoder, vae, unet = self.load_target_model(args, weight_dtype, accelerator)
File "E:\loratrain\lora-scripts-v1.10.0\scripts\dev\flux_train_network.py", line 93, in load_target_model
self.is_schnell, model = flux_utils.load_flow_model(
File "E:\loratrain\lora-scripts-v1.10.0\scripts\dev\library\flux_utils.py", line 136, in load_flow_model
info = model.load_state_dict(sd, strict=False, assign=True)
File "E:\loratrain\lora-scripts-v1.10.0\python\lib\site-packages\torch\nn\modules\module.py", line 2215, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Flux:
size mismatch for img_in.weight: copying a param with shape torch.Size([3072, 384]) from checkpoint, the shape in current model is torch.Size([3072, 64]).
I second this error. Did you come up with any solution?
Seems to be the same issue as this https://huggingface.co/black-forest-labs/FLUX.1-Fill-dev/discussions/2
Still unresolved
+1