apple/coreml-stable-diffusion-mixed-bit-palettization

Model

30

stars

7

commits

2

linked in READMEs

Jul 29, 2023

updated

core-ml
coreml

README

Core ML Stable Diffusion Mixed-Bit Palettization Resources

This repository contains resources related to the use of mixed-bit palettization techniques for Stable Diffusion. As explained in the original repo, this is an advanced compression technique that applies palettization using a varying number of bits per layer to keep quality above the desired threshold (as measured by the PSNR with respect to the original model). This can achieve strong space savings without resorting to learned quantization tables during fine-tuning.

The repository contains the following resources:

  • recipes/. JSON files with results from the analysis phase (Step 1 of the instructions) on three popular Stable Diffusion models:
    • Stable Diffusion 1.5
    • Stable Diffusion 2.1 base
    • Stable Diffusion XL 1.0 base

You can apply any of the available recipes on the appropriate model to experiment and compare results.

RecipeEffective bitsUNet size (GB)Size reduction
recipe_3_41_bit_mixedpalette3.411.177%
recipe_4_50_bit_mixedpalette4.501.471%
recipe_6_55_bit_mixedpalette6.552.058%

This repository was prepared by Apple and Hugging Face in July 2023, from experiments conducted using public beta versions of iOS 17.0, iPadOS 17.0 and macOS 14.0.

Contributors

pcuenq

7 commits

apple/coreml-stable-diffusion-mixed-bit-palettization

Model

30

stars

7

commits

2

linked in READMEs

Jul 29, 2023

updated

core-ml
coreml

README

Core ML Stable Diffusion Mixed-Bit Palettization Resources

This repository contains resources related to the use of mixed-bit palettization techniques for Stable Diffusion. As explained in the original repo, this is an advanced compression technique that applies palettization using a varying number of bits per layer to keep quality above the desired threshold (as measured by the PSNR with respect to the original model). This can achieve strong space savings without resorting to learned quantization tables during fine-tuning.

The repository contains the following resources:

  • recipes/. JSON files with results from the analysis phase (Step 1 of the instructions) on three popular Stable Diffusion models:
    • Stable Diffusion 1.5
    • Stable Diffusion 2.1 base
    • Stable Diffusion XL 1.0 base

You can apply any of the available recipes on the appropriate model to experiment and compare results.

RecipeEffective bitsUNet size (GB)Size reduction
recipe_3_41_bit_mixedpalette3.411.177%
recipe_4_50_bit_mixedpalette4.501.471%
recipe_6_55_bit_mixedpalette6.552.058%

This repository was prepared by Apple and Hugging Face in July 2023, from experiments conducted using public beta versions of iOS 17.0, iPadOS 17.0 and macOS 14.0.

Contributors

pcuenq

7 commits