stable-diffusion
stable-diffusion copied to clipboard
This Error with AutoEncoder started happening just hours ago
56
57 # encode the init image into latents and scale the latents
---> 58 init_latents = self.vae.encode(init_image.to(self.device)).sample()
59 init_latents = 0.18215 * init_latents
60
AttributeError: 'AutoencoderKLOutput' object has no attribute 'sample'
I've tried to control the version of diffusers I am using with the Colab... but what gives? Why did it all of the sudden stop working on all of my colabs?
Just Encountered this error as well
That is a change in https://github.com/huggingface/diffusers/releases/tag/v0.3.0, should be used like so now
https://github.com/huggingface/diffusers/blob/83a7bb2aba2d897ab95d96fb03eda10a624080e7/examples/textual_inversion/textual_inversion.py#L499-L501
use vae.encode(x).latent_dist.sample() might just work