Spaces:
Runtime error
Runtime error
Commit
·
53b4ba5
1
Parent(s):
600e525
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,21 @@ This app uses HuggingFace to generate an image based on the provided prompt. You
|
|
11 |
Click the "Generate Image" button to initiate the image generation process. Based on KVIImager API by KVI Kontent.
|
12 |
""")
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
custom_prompt = st.text_input("Enter your own prompt")
|
15 |
|
16 |
-
prompt = custom_prompt
|
17 |
|
18 |
if st.button('Generate Image'):
|
19 |
if prompt:
|
20 |
with st.spinner('Generating your image...'):
|
21 |
-
url = 'https://
|
22 |
params = {'prompt': prompt}
|
23 |
response = requests.get(url, params=params)
|
24 |
|
|
|
11 |
Click the "Generate Image" button to initiate the image generation process. Based on KVIImager API by KVI Kontent.
|
12 |
""")
|
13 |
|
14 |
+
# Pre-defined prompts
|
15 |
+
example_prompts = ["A cat sitting on a keyboard", "A futuristic cityscape", "Magical forest at night"]
|
16 |
+
|
17 |
+
# Select box for choosing examples
|
18 |
+
selected_prompt = st.selectbox("Select an example prompt", example_prompts)
|
19 |
+
|
20 |
+
# Input field for custom prompt
|
21 |
custom_prompt = st.text_input("Enter your own prompt")
|
22 |
|
23 |
+
prompt = selected_prompt if not custom_prompt else custom_prompt
|
24 |
|
25 |
if st.button('Generate Image'):
|
26 |
if prompt:
|
27 |
with st.spinner('Generating your image...'):
|
28 |
+
url = 'https://57b7-217-71-237-228.ngrok-free.app/generate_image'
|
29 |
params = {'prompt': prompt}
|
30 |
response = requests.get(url, params=params)
|
31 |
|