Views
No views yet

FLUX.1 Fill [dev] is a 12 billion parameter rectified flow transformer capable of filling areas in existing images based on a text description.
For more information, please read our blog post.FLUX.1 Fill [pro].FLUX.1 Fill [dev] more efficient.FLUX.1 [dev] Non-Commercial License.FLUX.1 Fill [dev], as well as sampling code, in a dedicated github repository.
Developers and creatives looking to build on top of FLUX.1 Fill [dev] are encouraged to use this as a starting point.
FLUX.1 Fill [dev] with the 🧨 diffusers python library, first install or upgrade diffuserspip install -U diffusersFluxFillPipeline to run the model1import torch
2from diffusers import FluxFillPipeline
3from diffusers.utils import load_image
4
5image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
6mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
7
8pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", torch_dtype=torch.bfloat16).to("cuda")
9image = pipe(
10 prompt="a white paper cup",
11 image=image,
12 mask_image=mask,
13 height=1632,
14 width=1232,
15 guidance_scale=30,
16 num_inference_steps=50,
17 max_sequence_length=512,
18 generator=torch.Generator("cpu").manual_seed(0)
19).images[0]
20image.save(f"flux-fill-dev.png")