amaanadeen commited on
Commit
76f6fdc
·
1 Parent(s): bc7bb23

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -31
app.py DELETED
@@ -1,31 +0,0 @@
1
- import streamlit as st
2
- from diffusers import StableDiffusionPipeline
3
- from PIL import Image
4
- import torch
5
-
6
- # Function to load the model
7
- @st.cache(allow_output_mutation=True)
8
- def load_model():
9
- # Replace 'your_token_here' with your actual Hugging Face token
10
- YOUR_TOKEN = ""
11
- pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=YOUR_TOKEN)
12
- return pipe
13
-
14
- # Load the model
15
- pipe = load_model()
16
-
17
- # Streamlit interface
18
- st.title("Text-to-Image Generation with Stable Diffusion")
19
-
20
- # Text input for the prompt
21
- prompt = st.text_input("Enter your prompt:")
22
-
23
- # Generate button
24
- if st.button("Generate Image"):
25
- with st.spinner('Generating image...'):
26
- # Generate image
27
- image = pipe(prompt).images[0]
28
-
29
- # Convert to PIL Image to display
30
- img = Image.fromarray(image)
31
- st.image(img, caption="Generated Image")