awacke1 commited on
Commit
233bb38
ยท
verified ยท
1 Parent(s): 9f668b1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +159 -0
app.py ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Prompt Recombobulator Deluxe 3000 - 9/28/2024 12:16 PM
2
+
3
+ st.markdown('''
4
+
5
+ # DK Tribute Educational Style Prompts for Various Themes
6
+
7
+ ## 1. Interior Design Prompts
8
+ **Prompt**:
9
+ "๐Ÿ›‹๏ธ Design a sleek, minimalist living room with mid-century modern furniture. Feature a plush velvet sofa in emerald green, a walnut coffee table, and brass accents throughout. Large floor-to-ceiling windows bring in natural light, highlighting the indoor potted plants and abstract art on the walls."
10
+
11
+ **Score**: 9/10
12
+ ---
13
+
14
+ ## 2. Portrait Prompts
15
+ **Prompt**:
16
+ "๐Ÿง‘โ€๐Ÿฆฑ A regal portrait of a person with intricate facial tattoos, wearing a flowing silk robe. Their expression is serene, as they sit under the dappled light of an ancient oak tree. The wind gently moves their long hair, and behind them, a mountain range glows in the soft light of dawn."
17
+
18
+ **Score**: 8/10
19
+ ---
20
+
21
+ ## 3. Landscapes Prompts
22
+ **Prompt**:
23
+ "๐Ÿž๏ธ A lush valley at sunrise, where a winding river reflects the pink and gold hues of the sky. Towering cliffs stand guard over a meadow of wildflowers in full bloom, while a lone eagle soars above. Mist rises from the forest below, blending with the soft morning light."
24
+
25
+ **Score**: 9.5/10
26
+ ---
27
+
28
+ ## 4. Science Fiction Prompts
29
+ **Prompt**:
30
+ "๐Ÿ‘ฉโ€๐Ÿš€ A futuristic cityscape where towering silver skyscrapers pierce the clouds. Hovering vehicles zoom through neon-lit airways, while giant holograms advertise interplanetary travel. In the distance, a massive spaceport sends ships off into the stars, with the planetโ€™s twin moons looming overhead."
31
+
32
+ **Score**: 9/10
33
+ ---
34
+
35
+ ## 5. Fantasy Prompts
36
+ **Prompt**:
37
+ "๐Ÿงš In a mystical forest, glowing mushrooms line the path that leads to an enchanted waterfall. Fairy lights twinkle in the trees, and a grand crystal castle can be seen in the distance, half-hidden by mist. A lone wizard in a flowing robe walks towards the castle, his staff casting a soft blue glow."
38
+
39
+ **Score**: 9.5/10
40
+ ---
41
+
42
+ ## 6. Video Games Prompts
43
+ **Prompt**:
44
+ "๐Ÿ•น๏ธ A post-apocalyptic wasteland where towering, crumbling structures dominate the skyline. Players navigate through ruined cities overtaken by nature, encountering hostile robots and rogue factions. In the distance, a massive, glowing energy field threatens to engulf the last remnants of civilization."
45
+
46
+ **Score**: 8.5/10
47
+ ---
48
+
49
+
50
+ ''')
51
+
52
+
53
+
54
+ import streamlit as st
55
+ from transformers import pipeline, set_seed
56
+ import random
57
+
58
+ # Set random seed to make results reproducible (but where's the fun in that? ๐ŸŽฒ)
59
+ set_seed(42)
60
+
61
+ # Load the GPT-2 model for text generation
62
+ # ๐Ÿค– Initializing the AI overlord... I mean, assistant!
63
+ generator = pipeline('text-generation', model='gpt2')
64
+
65
+ # Title of the app
66
+ st.title("๐Ÿ“ Prompt Recombobulator Deluxe 3000")
67
+
68
+ # Description
69
+ st.write("Welcome to the Prompt Recombobulator Deluxe 3000! ๐Ÿค–โœจ")
70
+ st.write("Feeling uninspired? Let's mash some prompts together and see what creative chaos ensues! ๐Ÿš€")
71
+
72
+ # List of topics
73
+ topics = [
74
+ "Interior Design",
75
+ "Portrait",
76
+ "Landscapes",
77
+ "Science Fiction",
78
+ "Fantasy",
79
+ "Video Games",
80
+ "Cinema",
81
+ "Graphic Design",
82
+ "Illustration",
83
+ "Architecture",
84
+ "Fashion Design",
85
+ "Food"
86
+ ]
87
+
88
+ # Sample prompts
89
+ sample_prompts = {
90
+ "Interior Design": "๐Ÿ›‹๏ธ Design a sleek, minimalist living room with mid-century modern furniture. Feature a plush velvet sofa in emerald green, a walnut coffee table, and brass accents throughout. Large floor-to-ceiling windows bring in natural light, highlighting the indoor potted plants and abstract art on the walls.",
91
+ "Portrait": "๐Ÿง‘โ€๐Ÿฆฑ A regal portrait of a person with intricate facial tattoos, wearing a flowing silk robe. Their expression is serene, as they sit under the dappled light of an ancient oak tree. The wind gently moves their long hair, and behind them, a mountain range glows in the soft light of dawn.",
92
+ "Landscapes": "๐Ÿž๏ธ A lush valley at sunrise, where a winding river reflects the pink and gold hues of the sky. Towering cliffs stand guard over a meadow of wildflowers in full bloom, while a lone eagle soars above. Mist rises from the forest below, blending with the soft morning light.",
93
+ "Science Fiction": "๐Ÿ‘ฉโ€๐Ÿš€ A futuristic cityscape where towering silver skyscrapers pierce the clouds. Hovering vehicles zoom through neon-lit airways, while giant holograms advertise interplanetary travel. In the distance, a massive spaceport sends ships off into the stars, with the planetโ€™s twin moons looming overhead.",
94
+ "Fantasy": "๐Ÿงš In a mystical forest, glowing mushrooms line the path that leads to an enchanted waterfall. Fairy lights twinkle in the trees, and a grand crystal castle can be seen in the distance, half-hidden by mist. A lone wizard in a flowing robe walks towards the castle, his staff casting a soft blue glow.",
95
+ "Video Games": "๐Ÿ•น๏ธ A post-apocalyptic wasteland where towering, crumbling structures dominate the skyline. Players navigate through ruined cities overtaken by nature, encountering hostile robots and rogue factions. In the distance, a massive, glowing energy field threatens to engulf the last remnants of civilization.",
96
+ "Cinema": "๐ŸŽฌ A dramatic scene where a lone detective walks through the rain-soaked streets of 1940s New York. Neon signs flicker in the background, and shadows hide the faces of passersby. The detective's trench coat and fedora are illuminated by the dim glow of street lamps as he approaches a smoky jazz club.",
97
+ "Graphic Design": "๐ŸŽจ Create a bold and modern poster for an upcoming tech conference. Use geometric shapes, vibrant gradients, and minimalistic typography. Incorporate icons representing AI, blockchain, and cybersecurity in a cohesive layout that grabs attention.",
98
+ "Illustration": "๐Ÿ–Œ๏ธ An imaginative illustration of a whimsical treehouse village connected by rope bridges. Each house is uniquely shaped, resembling mushrooms, teapots, and lanterns. Forest creatures like foxes and rabbits can be seen going about their day, adding a touch of magic to the scene.",
99
+ "Architecture": "๐Ÿ›๏ธ Design a futuristic eco-friendly skyscraper that incorporates vertical gardens and renewable energy sources. The building features sleek glass surfaces, wind turbines integrated into the structure, and open-air terraces that promote green living in an urban environment.",
100
+ "Fashion Design": "๐Ÿ‘— Create a haute couture gown inspired by the ocean. The dress flows like waves, with layers of iridescent fabrics resembling shimmering water. Embellishments include pearls, seashells, and beadwork that mimic coral reefs. The design should evoke the beauty and mystery of the deep sea.",
101
+ "Food": "๐Ÿฐ A decadent dessert table featuring an array of artisanal pastries. Macarons in pastel colors, miniature tarts topped with fresh berries, and a towering chocolate fountain surrounded by exotic fruits. The setup is elegant and enticing, perfect for a luxurious afternoon tea."
102
+ }
103
+
104
+ # Select a topic
105
+ topic = st.selectbox("Choose a theme ๐ŸŽจ:", topics)
106
+
107
+ # Display the sample prompt
108
+ st.write("Here's a sample prompt for the selected theme:")
109
+ st.write(sample_prompts[topic])
110
+
111
+ # User input prompt
112
+ user_prompt = st.text_area("Or write your own prompt here:", sample_prompts[topic])
113
+
114
+ # Function to generate a new prompt
115
+ def generate_prompt(prompt_text):
116
+ """Generate a new prompt based on the user's input prompt."""
117
+ # ๐Ÿค– Let's see what the AI chef cooks up! ๐Ÿ‘จโ€๐Ÿณ
118
+ generated = generator(prompt_text, max_length=150, num_return_sequences=1)
119
+ return generated[0]['generated_text']
120
+
121
+ # Generate button
122
+ if st.button("Generate New Prompt ๐ŸŽฒ"):
123
+ # Add a fun message
124
+ st.write("Hold on to your socks, generating awesomeness... ๐Ÿงฆโœจ")
125
+ with st.spinner("Cooking up some creative stew... ๐Ÿฅฃ"):
126
+ new_prompt = generate_prompt(user_prompt)
127
+ st.success("Here's your recombobulated prompt! ๐ŸŽ‰")
128
+ st.write(new_prompt)
129
+
130
+ # Add an amusing comment based on topic
131
+ if topic == "Science Fiction":
132
+ st.write("๐Ÿš€ May the prompts be ever in your favor!")
133
+ elif topic == "Fantasy":
134
+ st.write("๐Ÿง™โ€โ™‚๏ธ You shall not pass... without a new prompt!")
135
+ elif topic == "Video Games":
136
+ st.write("๐ŸŽฎ Achievement unlocked: New Prompt Generated!")
137
+ elif topic == "Interior Design":
138
+ st.write("๐Ÿ›‹๏ธ Home is where the prompt is.")
139
+ elif topic == "Portrait":
140
+ st.write("๐Ÿ–Œ๏ธ A picture is worth a thousand prompts.")
141
+ elif topic == "Landscapes":
142
+ st.write("๐ŸŒ„ Keep calm and wander on.")
143
+ elif topic == "Cinema":
144
+ st.write("๐ŸŽฌ That's a wrap on your new prompt!")
145
+ elif topic == "Graphic Design":
146
+ st.write("๐ŸŽจ Designing dreams one prompt at a time.")
147
+ elif topic == "Illustration":
148
+ st.write("๐Ÿ–๏ธ Sketching out some prompt perfection!")
149
+ elif topic == "Architecture":
150
+ st.write("๐Ÿ—๏ธ Building the future, one prompt at a time.")
151
+ elif topic == "Fashion Design":
152
+ st.write("๐Ÿ‘  Your prompt just hit the runway!")
153
+ elif topic == "Food":
154
+ st.write("๐Ÿด Bon appรฉtit! Your prompt is served.")
155
+ else:
156
+ st.write("โœจ Enjoy your new prompt!")
157
+
158
+ # Footer
159
+ st.write("Made with โค๏ธ and a dash of code magic. โœจ")