Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,8 @@ from diffusers import StableDiffusionPipeline
|
|
2 |
import torch
|
3 |
import streamlit as st
|
4 |
|
|
|
|
|
5 |
|
6 |
# Load the model
|
7 |
model_id = "CompVis/stable-diffusion-v1-4"
|
@@ -10,8 +12,6 @@ device = "cuda"
|
|
10 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
11 |
pipe = pipe.to(device)
|
12 |
|
13 |
-
st.set_page_config(page_title="π₯ Memeify - Text-to-Meme Generator π₯", page_icon="π₯", layout="wide")
|
14 |
-
|
15 |
# Custom styling for the page
|
16 |
st.markdown("""
|
17 |
</style>
|
@@ -40,7 +40,4 @@ if st.button("Generate Meme", key="generate", help="Click to generate a meme fro
|
|
40 |
# Save the image
|
41 |
image.save("generated_meme.png")
|
42 |
else:
|
43 |
-
st.warning("Please enter a description to generate a meme.")
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
2 |
import torch
|
3 |
import streamlit as st
|
4 |
|
5 |
+
# Set the page config as the very first command
|
6 |
+
st.set_page_config(page_title="π₯ Memeify - Text-to-Meme Generator π₯", page_icon="π₯", layout="wide")
|
7 |
|
8 |
# Load the model
|
9 |
model_id = "CompVis/stable-diffusion-v1-4"
|
|
|
12 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
13 |
pipe = pipe.to(device)
|
14 |
|
|
|
|
|
15 |
# Custom styling for the page
|
16 |
st.markdown("""
|
17 |
</style>
|
|
|
40 |
# Save the image
|
41 |
image.save("generated_meme.png")
|
42 |
else:
|
43 |
+
st.warning("Please enter a description to generate a meme.")
|
|
|
|
|
|