diffusers / FLUX.1-Fill-dev-nf4

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: November 24 2024

Introduction of FLUX.1-Fill-dev-nf4

Model Details of FLUX.1-Fill-dev-nf4

Contains the NF4 checkpoints ( transformer and text_encoder_2 ) of black-forest-labs/FLUX.1-Fill-dev . Please adhere to the original model licensing!

Code
from diffusers import DiffusionPipeline, FluxFillPipeline, FluxTransformer2DModel
import torch
from transformers import T5EncoderModel
from diffusers.utils import load_image
import fire


def load_pipeline(four_bit=False):
    orig_pipeline = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
    if four_bit:
        print("Using four bit.")
        transformer = FluxTransformer2DModel.from_pretrained(
            "sayakpaul/FLUX.1-Fill-dev-nf4", subfolder="transformer", torch_dtype=torch.bfloat16
        )
        text_encoder_2 = T5EncoderModel.from_pretrained(
            "sayakpaul/FLUX.1-Fill-dev-nf4", subfolder="text_encoder_2", torch_dtype=torch.bfloat16
        )
        pipeline = FluxFillPipeline.from_pipe(
            orig_pipeline, transformer=transformer, text_encoder_2=text_encoder_2, torch_dtype=torch.bfloat16
        )
    else:
        transformer = FluxTransformer2DModel.from_pretrained(
            "black-forest-labs/FLUX.1-Fill-dev",
            subfolder="transformer",
            revision="refs/pr/4",
            torch_dtype=torch.bfloat16,
        )
        pipeline = FluxFillPipeline.from_pipe(orig_pipeline, transformer=transformer, torch_dtype=torch.bfloat16)

    pipeline.enable_model_cpu_offload()
    return pipeline


def load_conditions():
    image = load_image("https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/cup.png")
    mask = load_image("https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/cup_mask.png")
    return image, mask


def main(four_bit: bool = False):
    pipe = load_pipeline(four_bit=four_bit)
    ckpt_id = "sayakpaul/FLUX.1-Fill-dev-nf4"
    image, mask = load_conditions()
    image = pipe(
        prompt="a white paper cup",
        image=image,
        mask_image=mask,
        height=1024,
        width=1024,
        max_sequence_length=512,
        generator=torch.Generator("cpu").manual_seed(0),
    ).images[0]
    filename = "output_" + ckpt_id.split("/")[-1].replace(".", "_")
    filename += "_4bit" if four_bit else ""
    image.save(f"{filename}.png")


if __name__ == "__main__":
    fire.Fire(main)
Outputs
Original NF4
Original NF4

Runs of diffusers FLUX.1-Fill-dev-nf4 on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About FLUX.1-Fill-dev-nf4 huggingface.co Model

FLUX.1-Fill-dev-nf4 huggingface.co

FLUX.1-Fill-dev-nf4 huggingface.co is an AI model on huggingface.co that provides FLUX.1-Fill-dev-nf4's model effect (), which can be used instantly with this diffusers FLUX.1-Fill-dev-nf4 model. huggingface.co supports a free trial of the FLUX.1-Fill-dev-nf4 model, and also provides paid use of the FLUX.1-Fill-dev-nf4. Support call FLUX.1-Fill-dev-nf4 model through api, including Node.js, Python, http.

FLUX.1-Fill-dev-nf4 huggingface.co Url

https://huggingface.co/diffusers/FLUX.1-Fill-dev-nf4

diffusers FLUX.1-Fill-dev-nf4 online free

FLUX.1-Fill-dev-nf4 huggingface.co is an online trial and call api platform, which integrates FLUX.1-Fill-dev-nf4's modeling effects, including api services, and provides a free online trial of FLUX.1-Fill-dev-nf4, you can try FLUX.1-Fill-dev-nf4 online for free by clicking the link below.

diffusers FLUX.1-Fill-dev-nf4 online free url in huggingface.co:

https://huggingface.co/diffusers/FLUX.1-Fill-dev-nf4

FLUX.1-Fill-dev-nf4 install

FLUX.1-Fill-dev-nf4 is an open source model from GitHub that offers a free installation service, and any user can find FLUX.1-Fill-dev-nf4 on GitHub to install. At the same time, huggingface.co provides the effect of FLUX.1-Fill-dev-nf4 install, users can directly use FLUX.1-Fill-dev-nf4 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

FLUX.1-Fill-dev-nf4 install url in huggingface.co:

https://huggingface.co/diffusers/FLUX.1-Fill-dev-nf4

Url of FLUX.1-Fill-dev-nf4

FLUX.1-Fill-dev-nf4 huggingface.co Url

Provider of FLUX.1-Fill-dev-nf4 huggingface.co

diffusers
ORGANIZATIONS

Other API from diffusers

huggingface.co

Total runs: 5.3K
Run Growth: 0
Growth Rate: 0.00%
Updated: October 22 2024
huggingface.co

Total runs: 4.0K
Run Growth: -1.5K
Growth Rate: -39.10%
Updated: February 08 2023
huggingface.co

Total runs: 463
Run Growth: 146
Growth Rate: 31.53%
Updated: February 23 2025
huggingface.co

Total runs: 34
Run Growth: 25
Growth Rate: 75.76%
Updated: January 27 2023
huggingface.co

Total runs: 12
Run Growth: -4
Growth Rate: -30.77%
Updated: February 06 2024