Text2img / app.py
3laa2's picture
Update app.py
038d520
raw
history blame
417 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.float16)
if len(area) > 5:
image = pipe(area).images[0]
im = Image.open(image)
st.image(im)
else :
st.text_input("No","No")