Text2img / app.py
3laa2's picture
Update app.py
160d299
raw
history blame
427 Bytes
import streamlit as st
from PIL import Image
import torch
from diffusers import StableDiffusionPipeline
st.title(" New App")
area = st.text_area("Area",'')
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float32)
if len(area) > 5:
image = pipe(area).images
print(len(image),type(image),image.shape)
im = Image.open(image[0])
st.image(im)