Spaces:
Runtime error
Runtime error
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() | |