How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import FluxFillPipeline
from diffusers.utils import load_image

image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")

# switch to "mps" for apple devices
pipe = FluxFillPipeline.from_pretrained("SamuelTallet/FLUX.1-Fill-dev-SDNQ-4bit-dynamic-hadamard256", dtype=torch.bfloat16, device_map="cuda")
image = pipe(
    prompt="a white paper cup",
    image=image,
    mask_image=mask,
    height=1632,
    width=1232,
    guidance_scale=30,
    num_inference_steps=50,
    max_sequence_length=512,
    generator=torch.Generator("cpu").manual_seed(0)
).images[0]
image.save(f"flux-fill-dev.png")

This is FLUX.1 Fill [dev] optimized using SDNQ with UINT4 dynamic quantization and Hadamard Rotation (Group size: 256).

Sample

Input Mask Output
Input image: a white paper cup in the sand Inpainting mask Output image: two white paper cups in the sand, one of which was generated in the masked area

Prompt:

a white paper cup

Seed: 0

Usage

Install Torch, Diffusers (Git), SDNQ 0.2.0+ and Triton.

Use CFG 30 and 50 steps.

Downloads last month
35
Safetensors
Model size
6B params
Tensor type
BF16
ยท
U8
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for SamuelTallet/FLUX.1-Fill-dev-SDNQ-4bit-dynamic-hadamard256

Quantized
(25)
this model