XavierXiao / Dreambooth-Stable-Diffusion

Implementation of Dreambooth (https://arxiv.org/abs/2208.12242) with Stable Diffusion
MIT License
7.57k stars 790 forks source link

How to reduce the size of trained model ? #22

Open sausax opened 1 year ago

sausax commented 1 year ago

Any ideas on how to reduce the size of the trained model from 12gb to 4gb(same as original stable diffusion checkpoint) ?

kitty7779 commented 1 year ago

I used this script which reduced it to 2gb in my case. https://github.com/harubaru/waifu-diffusion/blob/main/scripts/prune.py Replace "models/ldm/stable-diffusion-v1/model.ckpt" with the path to whatever ckpt file you want to prune

JoePenna commented 1 year ago

+1 on what @kitty7779 said.

This repo automatically prunes the ckpt down to 2GB after creation (takes about 15-20 extra seconds) https://github.com/JoePenna/Dreambooth-Stable-Diffusion/

Use main_prune.py for that.