when I try to excute the code:
from torch import autocast
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained(
“CompVis/stable-diffusion-v1-4”,
use_auth_token=True
).to(“cuda”)
prompt = “a photo of an astronaut riding a horse on mars”
with autocast(“cuda”):
image = pipe(prompt)[“sample”][0]
image.save(“astronaut_rides_horse.png”)
It showed me that
AttributeError: ‘StableDiffusionPipeline’ object has no attribute ‘to’
‘pip install --upgrade diffusers’ is not worked
what should I do to solve this question? is it a version problem?