File size: 2,077 Bytes
ed64d4e 15d0d7e ed64d4e 15d0d7e ed64d4e 15d0d7e ed64d4e 15d0d7e ed64d4e 15d0d7e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
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() |