diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

[Community] Is there a code for pre-training stable diffusion?

Open 980202006 opened this issue 1 year ago • 1 comments

This project works great. Is there a code for pre-training stable diffusion?

980202006 avatar Nov 22 '22 02:11 980202006

Hey @980202006,

Thanks for the nice words, we currently don't have a pretraining script for stable diffusion. Currently I don't think we have the time to support such a new script, but we would welcome any contribution from the community.

Also cc'ing @patil-suraj here FYI.

patrickvonplaten avatar Nov 28 '22 12:11 patrickvonplaten

Thank you!

980202006 avatar Dec 01 '22 02:12 980202006

The train_text_to_image script can be adapted for pre-training stable diffusion. With SD, pre-training and fine-tuning objectives are similar. https://github.com/huggingface/diffusers/tree/main/examples/text_to_image, so to train from scratch we'll have to load random models, initialize the correct scheduler, handle data pre-processing etc.

patil-suraj avatar Dec 23 '22 16:12 patil-suraj

@patil-suraj Thank you! Do you know the approximate loss of vae convergence? The vae loss I trained is very large.

980202006 avatar Dec 26 '22 02:12 980202006

No, I haven't trained VAE. Also, stable diffusion does not train VAE, it uses pre-trained VAE checkpoints trained with taming-transformer. In stable diffusion only the unet is trained, the rest is frozen.

patil-suraj avatar Dec 26 '22 11:12 patil-suraj