--- license: other license_name: flux-1-dev-non-commercial-license license_link: https://huggingface.co/black-forest-labs/FLUX.1-Krea-dev/blob/main/LICENSE.md base_model: black-forest-labs/FLUX.1-Krea-dev pipeline_tag: text-to-image library_name: diffusers tags: - flux - nunchaku - svdquant - int4 - quantization --- # FLUX.1 Krea Dev Nunchaku Lite INT4 r32 Diffusers-loadable conversion of: - Base model: `black-forest-labs/FLUX.1-Krea-dev` - Source repo: `nunchaku-ai/nunchaku-flux.1-krea-dev` - Source checkpoint: `svdq-int4_r32-flux.1-krea-dev.safetensors` The transformer uses `quant_method: nunchaku_lite`, INT4 SVDQ with group size 64, runtime rank 64, 418 SVDQ targets, and 76 AWQ W4A16 targets. The CLIP encoder is copied from the base model and T5 `text_encoder_2` is BitsAndBytes 4-bit NF4. Fused QKV modules are split in logical tensor layout; single-block `proj_out` is merged from attention and MLP projections; low-rank tensors are logically padded to rank 64. INT4 shifted down-projection biases are compensated for signed-unfused Diffusers execution. ## Benchmark | Checkpoint | Latency | Max VRAM | | --- | ---: | ---: | | Converted Diffusers Nunchaku Lite INT4 r32 + BNB4 T5 | 26.99 s (stdev 0.03 s) | 16.42 GiB | RTX 5090, 1024×1024, 28 steps, guidance scale 3.5, one warmup and three measured runs, full GPU placement. VRAM is peak total device usage sampled with `nvidia-smi`, including allocations outside PyTorch's caching allocator. ## Output Comparison ![Native reference (left) and converted output (right)](output_comparison.png) Both images use the same prompt, seed 0, scheduler, resolution, and step count. Native Nunchaku 1.x refuses INT4 checkpoints on Blackwell GPUs, so a same-precision native benchmark was unavailable on the RTX 5090. ## Run Requires the Hugging Face `kernels` package and a Turing, Ampere, Ada, or Blackwell NVIDIA GPU; Hopper is unsupported for INT4 kernels. ```python import torch from diffusers import FluxPipeline pipe = FluxPipeline.from_pretrained( "lite-infer/flux.1-krea-dev-nunchaku-lite-int4_r32-bnb4-text-encoder", torch_dtype=torch.bfloat16, ).to("cuda") image = pipe( prompt='A cinematic photograph of a red fox standing in a misty forest at sunrise, detailed fur, volumetric light', generator=torch.Generator("cuda").manual_seed(0), width=1024, height=1024, num_inference_steps=28, guidance_scale=3.5, ).images[0] image.save("output.png") ```