rainbow-canvas / app.py
homer-meng's picture
Update app.py
0b87cae
raw
history blame
332 Bytes
import torch
from diffusers import StableDiffusionPipeline
from PIL import Image
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = st.text_area("Enter a prompt: ")
image = pipe(prompt).images[0]
image = Image.fromarray(image)
image.show()