Downloads · 30 days
1.2K
9% of all-time downloads
DFloat11/FLUX.1-schnell-DF11
FLUX.1-schnell-DF11 is a text-to-image model from DFloat11. Use it when you need an image from a text prompt. It is set up for diffusers.
This is a losslessly compressed version of black-forest-labs/FLUX.1-schnell using our custom DFloat11 format. The outputs of this compressed model are bit-for-bit identical to the original BFloat16 model, while reduci…
Downloads · 30 days
1.2K
9% of all-time downloads
All-time downloads
13.6K
Public
Parameters
53.9M
16.3 GB on disk
Likes
7
Public
Click a slice to open those files.
.safetensors16.3 GB · 100%
From the Hugging Face model README
black-forest-labs/FLUX.1-schnellThis is a losslessly compressed version of black-forest-labs/FLUX.1-schnell using our custom DFloat11 format. The outputs of this compressed model are bit-for-bit identical to the original BFloat16 model, while reducing GPU memory consumption by approximately 30%.
DFloat11 compresses model weights using Huffman coding of BFloat16 exponent bits, combined with hardware-aware algorithmic designs that enable efficient on-the-fly decompression directly on the GPU. During inference, the weights remain compressed in GPU memory and are decompressed just before matrix multiplications, then immediately discarded after use to minimize memory footprint.
Key benefits:
Install the DFloat11 pip package (installs the CUDA kernel automatically; requires a CUDA-compatible GPU and PyTorch installed):
pip install dfloat11[cuda12]
# or if you have CUDA version 11:
# pip install dfloat11[cuda11]
To use the DFloat11 model, run the following example code in Python:
import torch
from diffusers import FluxPipeline
from dfloat11 import DFloat11Model
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()
DFloat11Model.from_pretrained('DFloat11/FLUX.1-schnell-DF11', device='cpu', bfloat16_model=pipe.transformer)
prompt = "A futuristic cityscape at sunset, with flying cars, neon lights, and reflective water canals"
image = pipe(
prompt,
guidance_scale=0.0,
num_inference_steps=4,
max_sequence_length=256,
generator=torch.Generator("cpu").manual_seed(0)
).images[0]
image.save("flux-schnell.png")