Kvikontent commited on
Commit
4d83aec
·
1 Parent(s): b7bcee1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -2,14 +2,26 @@ import streamlit as st
2
  import requests
3
  from PIL import Image
4
  from io import BytesIO
5
- import time
6
 
7
  st.title('CreativeAI')
8
- st.write('This is AI image generation based on KVIImager 2.0 API by KVI Kontent')
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  # Input field for custom prompt
11
  custom_prompt = st.text_input("Enter your own prompt")
12
 
 
 
13
  if st.button('Generate Image'):
14
  if prompt:
15
  with st.spinner('Generating your image...'):
 
2
  import requests
3
  from PIL import Image
4
  from io import BytesIO
 
5
 
6
  st.title('CreativeAI')
7
+
8
+ # Description
9
+ st.write("""
10
+ This app uses HuggingFace to generate an image based on the provided prompt. You can either select an example prompt from the dropdown list or enter your own prompt.
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...'):