Spaces:
Sleeping
Sleeping
from diffusers import DiffusionPipeline | |
import torch | |
# Load the pipeline | |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1-base", torch_dtype=torch.float16) | |
pipe.to("cpu") | |
# Get the prompt from the user | |
prompt = input("What do you want to see? ") | |
# Generate the image | |
image = pipe(prompt).images[0] | |
# Display the image | |
image.show() | |
# Print a message | |
print("How cool is this!") | |