'StableDiffusionPipeline' is not defined

#161
by BStrum - opened

I running windows 10 on an I9 with a 4080 ti gpu
python version 3.9 and using Anaconda

Here is my code based on the example on the model card:
import torch
print("torch version",torch.version)

pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp32")
pipe = pipe.to(device)
pipe.enable_attention_slicing()

prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]

image.save("astronaut_rides_horse.png")

C:\Users\Conda\envs\tf-gpu\python.exe C:\Users\User\Stable\SAtable_01.py
torch version 1.13.0
Traceback (most recent call last):
File "C:\Users\User\Stable\SAtable_01.py", line 4, in
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp32")
NameError: name 'StableDiffusionPipeline' is not defined

Process finished with exit code 1

Where do I get StableDiffusionPipeline
Please advise.

This comment has been hidden

Sign up or log in to comment