Update app.py
Browse files
app.py
CHANGED
@@ -1,43 +1,67 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
|
|
|
|
4 |
|
5 |
-
|
|
|
|
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
QT
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
QT Pink
|
28 |
-
QT Purple
|
29 |
-
QT Rain
|
30 |
-
QT Red Moon
|
31 |
-
QT Rose
|
32 |
-
QT Snow
|
33 |
-
QT Spacesuit Girl
|
34 |
-
QT Steampunk
|
35 |
-
QT Succubus
|
36 |
-
QT Sunlight
|
37 |
-
QT Weird art
|
38 |
-
QT White Hair
|
39 |
-
QT Wings art
|
40 |
-
QT Woman with Sword
|
41 |
-
'''
|
42 |
|
43 |
-
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
def handle_prompt_click(prompt_text, key):
|
4 |
+
st.session_state[f'selected_prompt_{key}'] = prompt_text
|
5 |
+
st.write(f"Generated prompt for: {prompt_text}")
|
6 |
|
7 |
+
def main():
|
8 |
+
st.title("๐จ Art Prompt Generator")
|
9 |
+
st.markdown("### Select a prompt style to generate artwork:")
|
10 |
|
11 |
+
# Dictionary mapping prompts to emojis
|
12 |
+
prompt_emojis = {
|
13 |
+
"AIart/AIArtistCommunity": "๐ค",
|
14 |
+
"Black & White": "โซโช",
|
15 |
+
"Black & Yellow": "โซ๐",
|
16 |
+
"Blindfold": "๐",
|
17 |
+
"Break": "๐",
|
18 |
+
"Broken": "๐จ",
|
19 |
+
"Christmas Celebrations art": "๐",
|
20 |
+
"Colorful Art": "๐จ",
|
21 |
+
"Crimson art": "๐ด",
|
22 |
+
"Eyes Art": "๐๏ธ",
|
23 |
+
"Going out with Style": "๐",
|
24 |
+
"Hooded Girl": "๐งฅ",
|
25 |
+
"Lips": "๐",
|
26 |
+
"MAEKHLONG": "๐ฎ",
|
27 |
+
"Mermaid": "๐งโโ๏ธ",
|
28 |
+
"Morning Sunshine": "๐
",
|
29 |
+
"Music Art": "๐ต",
|
30 |
+
"Owl": "๐ฆ",
|
31 |
+
"Pink": "๐",
|
32 |
+
"Purple": "๐",
|
33 |
+
"Rain": "๐ง๏ธ",
|
34 |
+
"Red Moon": "๐",
|
35 |
+
"Rose": "๐น",
|
36 |
+
"Snow": "โ๏ธ",
|
37 |
+
"Spacesuit Girl": "๐ฉโ๐",
|
38 |
+
"Steampunk": "โ๏ธ",
|
39 |
+
"Succubus": "๐",
|
40 |
+
"Sunlight": "โ๏ธ",
|
41 |
+
"Weird art": "๐ญ",
|
42 |
+
"White Hair": "๐ฑโโ๏ธ",
|
43 |
+
"Wings art": "๐ผ",
|
44 |
+
"Woman with Sword": "โ๏ธ"
|
45 |
+
}
|
46 |
|
47 |
+
# Create columns for better button layout
|
48 |
+
col1, col2, col3 = st.columns(3)
|
49 |
+
|
50 |
+
# Distribute buttons across columns
|
51 |
+
for idx, (prompt, emoji) in enumerate(prompt_emojis.items()):
|
52 |
+
full_prompt = f"QT {prompt}"
|
53 |
+
col = [col1, col2, col3][idx % 3]
|
54 |
+
|
55 |
+
with col:
|
56 |
+
if st.button(f"{emoji} {prompt}", key=f"btn_{idx}"):
|
57 |
+
handle_prompt_click(full_prompt, idx)
|
58 |
+
|
59 |
+
# Display selected prompt if any
|
60 |
+
st.markdown("---")
|
61 |
+
st.markdown("### Generated Prompts:")
|
62 |
+
for key in st.session_state:
|
63 |
+
if key.startswith('selected_prompt_'):
|
64 |
+
st.write(st.session_state[key])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
+
if __name__ == "__main__":
|
67 |
+
main()
|