--- license: apache-2.0 library_name: diffusers pipeline_tag: text-to-image base_model: - black-forest-labs/FLUX.1-dev --- # Scale-wise Distillation FLUX Scale-wise Distillation (SwD) is a novel framework for accelerating diffusion models (DMs) by progressively increasing spatial resolution during the generation process.
SwD achieves significant speedups (2.5× to 10×) compared to full-resolution models while maintaining or even improving image quality. ![FLUX Demo Image](swd.png) Project page: https://yandex-research.github.io/swd
GitHub: https://github.com/yandex-research/swd
Demo: https://huggingface.co/spaces/dbaranchuk/Scale-wise-Distillation ## Usage Upgrade to the latest version of the [🧨 diffusers](https://github.com/huggingface/diffusers) and [🧨 peft](https://github.com/huggingface/peft) ``` pip install -U diffusers pip install -U peft ``` and then you can run
```py import torch from diffusers import FluxPipeline from peft import PeftModel pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, custom_pipeline="quickjkee/swd_pipeline_flux").to("cuda") lora_path = "yresearch/swd_flux" pipe.transformer = PeftModel.from_pretrained( pipe.transformer, lora_path, ) sigmas = [1.0000, 0.8956, 0.7363, 0.6007, 0.0000] scales = [64, 80, 96, 128] prompt = "Cute winter dragon baby, kawaii, Pixar, ultra detailed, glacial background, extremely realistic." image = pipe( prompt=prompt, height=int(scales[0] * 8), width=int(scales[0] * 8), scales=scales, sigmas=sigmas, timesteps=torch.tensor(sigmas[:-1], device="cuda") * 1000, guidance_scale=4.5, max_sequence_length=512, ).images[0] ```

## Citation ```bibtex @inproceedings{ starodubcev2026scalewise, title={Scale-wise Distillation of Diffusion Models}, author={Nikita Starodubcev and Ilya Drobyshevskiy and Denis Kuznedelev and Artem Babenko and Dmitry Baranchuk}, booktitle={The Fourteenth International Conference on Learning Representations}, year={2026}, url={https://openreview.net/forum?id=Z06LNjqU1g} } ```