Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def load_pipeline():
|
|
12 |
use_safetensors=True,
|
13 |
variant="fp16"
|
14 |
)
|
15 |
-
pipe.to("
|
16 |
return pipe
|
17 |
|
18 |
pipe = load_pipeline()
|
@@ -22,8 +22,8 @@ st.title("Stable Diffusion XL Prompt-to-Image Generator")
|
|
22 |
st.write("Enter a prompt to generate an image using the Stable Diffusion XL model.")
|
23 |
|
24 |
# User inputs
|
25 |
-
user_prompt = st.text_input("Enter your prompt:"
|
26 |
-
negative_prompt = st.text_input("Enter a negative prompt (
|
27 |
|
28 |
# Generate button
|
29 |
if st.button("Generate Image"):
|
|
|
12 |
use_safetensors=True,
|
13 |
variant="fp16"
|
14 |
)
|
15 |
+
pipe.to("cpu") # Change to "cpu" if no GPU available
|
16 |
return pipe
|
17 |
|
18 |
pipe = load_pipeline()
|
|
|
22 |
st.write("Enter a prompt to generate an image using the Stable Diffusion XL model.")
|
23 |
|
24 |
# User inputs
|
25 |
+
user_prompt = st.text_input("Enter your prompt:")
|
26 |
+
negative_prompt = st.text_input("Enter a negative prompt (ugly, blurry, poor quality):")
|
27 |
|
28 |
# Generate button
|
29 |
if st.button("Generate Image"):
|