rainbow-canvas / app.py
homer-meng's picture
Update app.py
3712481
raw
history blame
355 Bytes
import torch
import streamlit as st
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()