savvaki/LPDM

Very good article, but unfortunately the code is written in pytorch-lightning framework

Lixuanhe opened this issue · 4 comments

Very good article, but unfortunately the code is written in pytorch-lightning framework

I am sorry that this disappoints you. PyTorch lighting (PL) is actually only used because the original Stable Diffusion repo used PL, and this is a fork of that repo. The good news is that the PL is just a different way to organize normal pytorch, see here some of the differences. The model weights are actually the same as normal pytorch, you could technically convert the one to the other with some effort, see here.

Otherwise which framework would you have preferred?

Thank you for your interest!

Thank you for your patience in replying. I have not used pytorch-lightning before and the code looks a bit different from pytorch, but I believe pytorch-lightning is easy to get started.

I also had to get used to PL myself. Personally I prefer normal PyTorch, but since this is a fork I had to get used to it. Honestly, PL makes it much easier to rapidly experiment. The reason is that the training loop is now part of the model in PL. This makes it easy to change the training loop for each model you make. In normal PyTorch, the same training loop is used for all your models, and this makes it much messier than PL when you need to change that training loop.

I would recommend looking at this video where The AI Epiphany explains the original code that this repo is forked from.

Thank you very much!