AttributeError: 'AutoencoderKLOutput' object has no attribute 'sample'

#235
by Nobparad - opened

How to fix this
Screenshot 2023-10-26 045647.jpg

Traceback (most recent call last):
File "C:\Users\HP.conda\envs\ldm\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "scripts/draw.py", line 48, in save
out = self.model([self.prompt_input.get(1.0, "end-1c")], init_image=drawn_img)["sample"][0]
File "C:\Users\HP.conda\envs\ldm\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "C:\Users\HP\Downloads\stable-diffusion-draw-main\scripts\diffusion_img2img.py", line 88, in call
init_latents = self.vae.encode(init_image.to(self.device))[0].sample()
AttributeError: 'AutoencoderKLOutput' object has no attribute 'sample'

Sign up or log in to comment