stablediffusion
stablediffusion copied to clipboard
Fixes an issue when training embedding
In certain cases (most notably on Colab using Automatic1111's WebUI, but not limited to that example) trying to train an embedding would cause https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5821#issue-1501645853 this error.
@Gazzoo-byte thanks for the PR ❤ maybe this is a better solution
https://github.com/Stability-AI/stablediffusion/blob/d55bcd4d31d0316fcbdf552f2fd2628fdc812500/ldm/models/diffusion/ddpm.py#L903
logvar_t = self.logvar[t].to(self.device) to logvar_t = self.logvar[t.item()].to(self.device)