awacke1's picture
Update app.py
15d0d7e verified
raw
history blame
2.08 kB
import streamlit as st
def handle_prompt_click(prompt_text, key):
st.session_state[f'selected_prompt_{key}'] = prompt_text
st.write(f"Generated prompt for: {prompt_text}")
def main():
st.title("๐ŸŽจ Art Prompt Generator")
st.markdown("### Select a prompt style to generate artwork:")
# Dictionary mapping prompts to emojis
prompt_emojis = {
"AIart/AIArtistCommunity": "๐Ÿค–",
"Black & White": "โšซโšช",
"Black & Yellow": "โšซ๐Ÿ’›",
"Blindfold": "๐Ÿ™ˆ",
"Break": "๐Ÿ’”",
"Broken": "๐Ÿ”จ",
"Christmas Celebrations art": "๐ŸŽ„",
"Colorful Art": "๐ŸŽจ",
"Crimson art": "๐Ÿ”ด",
"Eyes Art": "๐Ÿ‘๏ธ",
"Going out with Style": "๐Ÿ’ƒ",
"Hooded Girl": "๐Ÿงฅ",
"Lips": "๐Ÿ‘„",
"MAEKHLONG": "๐Ÿฎ",
"Mermaid": "๐Ÿงœโ€โ™€๏ธ",
"Morning Sunshine": "๐ŸŒ…",
"Music Art": "๐ŸŽต",
"Owl": "๐Ÿฆ‰",
"Pink": "๐Ÿ’—",
"Purple": "๐Ÿ’œ",
"Rain": "๐ŸŒง๏ธ",
"Red Moon": "๐ŸŒ‘",
"Rose": "๐ŸŒน",
"Snow": "โ„๏ธ",
"Spacesuit Girl": "๐Ÿ‘ฉโ€๐Ÿš€",
"Steampunk": "โš™๏ธ",
"Succubus": "๐Ÿ˜ˆ",
"Sunlight": "โ˜€๏ธ",
"Weird art": "๐ŸŽญ",
"White Hair": "๐Ÿ‘ฑโ€โ™€๏ธ",
"Wings art": "๐Ÿ‘ผ",
"Woman with Sword": "โš”๏ธ"
}
# Create columns for better button layout
col1, col2, col3 = st.columns(3)
# Distribute buttons across columns
for idx, (prompt, emoji) in enumerate(prompt_emojis.items()):
full_prompt = f"QT {prompt}"
col = [col1, col2, col3][idx % 3]
with col:
if st.button(f"{emoji} {prompt}", key=f"btn_{idx}"):
handle_prompt_click(full_prompt, idx)
# Display selected prompt if any
st.markdown("---")
st.markdown("### Generated Prompts:")
for key in st.session_state:
if key.startswith('selected_prompt_'):
st.write(st.session_state[key])
if __name__ == "__main__":
main()