Scartxx commited on
Commit
f9fa6a6
·
verified ·
1 Parent(s): 5c56d73

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +731 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Text To Image Prompt Generator
3
- emoji: 📈
4
- colorFrom: indigo
5
- colorTo: pink
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: text-to-image-prompt-generator
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,731 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>AI Image Prompt Generator</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .flavor-tag {
11
+ transition: all 0.2s ease;
12
+ }
13
+ .flavor-tag:hover {
14
+ transform: scale(1.05);
15
+ box-shadow: 0 2px 5px rgba(0,0,0,0.2);
16
+ }
17
+ .flavor-tag.selected {
18
+ background-color: #4f46e5;
19
+ color: white;
20
+ }
21
+ .prompt-history-item {
22
+ transition: all 0.2s ease;
23
+ }
24
+ .prompt-history-item:hover {
25
+ background-color: #f3f4f6;
26
+ }
27
+ .nsfw-field {
28
+ max-height: 0;
29
+ overflow: hidden;
30
+ transition: max-height 0.3s ease-out;
31
+ }
32
+ .nsfw-field.visible {
33
+ max-height: 200px;
34
+ }
35
+ .autocomplete-items {
36
+ position: absolute;
37
+ border: 1px solid #d4d4d4;
38
+ border-bottom: none;
39
+ border-top: none;
40
+ z-index: 99;
41
+ top: 100%;
42
+ left: 0;
43
+ right: 0;
44
+ background-color: white;
45
+ max-height: 200px;
46
+ overflow-y: auto;
47
+ }
48
+ .autocomplete-items div {
49
+ padding: 10px;
50
+ cursor: pointer;
51
+ background-color: #fff;
52
+ border-bottom: 1px solid #d4d4d4;
53
+ }
54
+ .autocomplete-items div:hover {
55
+ background-color: #e9e9e9;
56
+ }
57
+ .autocomplete-active {
58
+ background-color: #4f46e5 !important;
59
+ color: #ffffff;
60
+ }
61
+ </style>
62
+ </head>
63
+ <body class="bg-gray-100 min-h-screen">
64
+ <div class="container mx-auto px-4 py-8">
65
+ <div class="max-w-6xl mx-auto">
66
+ <h1 class="text-4xl font-bold text-center text-indigo-800 mb-2">AI Image Prompt Generator</h1>
67
+ <p class="text-center text-gray-600 mb-8">Create detailed prompts for AI image generation</p>
68
+
69
+ <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
70
+ <!-- Theme Presets -->
71
+ <div class="mb-8">
72
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">Theme Presets</h2>
73
+ <div class="flex flex-wrap gap-3">
74
+ <button onclick="applyTheme('rockstar')" class="px-4 py-2 bg-black text-white rounded-full hover:bg-gray-800 transition flex items-center gap-2">
75
+ <i class="fas fa-guitar"></i> Rockstar
76
+ </button>
77
+ <button onclick="applyTheme('vintage')" class="px-4 py-2 bg-amber-600 text-white rounded-full hover:bg-amber-700 transition flex items-center gap-2">
78
+ <i class="fas fa-camera-retro"></i> Vintage
79
+ </button>
80
+ <button onclick="applyTheme('fun')" class="px-4 py-2 bg-pink-500 text-white rounded-full hover:bg-pink-600 transition flex items-center gap-2">
81
+ <i class="fas fa-laugh-squint"></i> Fun
82
+ </button>
83
+ <button onclick="applyTheme('erotic')" class="px-4 py-2 bg-red-500 text-white rounded-full hover:bg-red-600 transition flex items-center gap-2">
84
+ <i class="fas fa-heart"></i> Erotic
85
+ </button>
86
+ <button onclick="applyTheme('surreal')" class="px-4 py-2 bg-purple-500 text-white rounded-full hover:bg-purple-600 transition flex items-center gap-2">
87
+ <i class="fas fa-moon"></i> Surreal
88
+ </button>
89
+ </div>
90
+ </div>
91
+
92
+ <!-- Main Form -->
93
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
94
+ <div class="autocomplete">
95
+ <label class="block text-gray-700 mb-2">Main Subject</label>
96
+ <input type="text" id="mainSubject" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g., McKayla Maroney and Emma Watson" autocomplete="off">
97
+ </div>
98
+ <div>
99
+ <label class="block text-gray-700 mb-2">Style and Appearance</label>
100
+ <input type="text" id="styleAppearance" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g., watercolor, surreal twist">
101
+ </div>
102
+ <div>
103
+ <label class="block text-gray-700 mb-2">Character Description</label>
104
+ <input type="text" id="characterDesc" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g., as an interdimensional traveler, body made of stars">
105
+ </div>
106
+ <div>
107
+ <label class="block text-gray-700 mb-2">Scene Details</label>
108
+ <input type="text" id="sceneDetails" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g., ancient temple ruins, golden hour lighting">
109
+ </div>
110
+ <div>
111
+ <label class="block text-gray-700 mb-2">Technical Settings</label>
112
+ <input type="text" id="techSettings" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g., --ar 3:2 --ISO 800 --aperture f/2.2">
113
+ </div>
114
+ <div>
115
+ <label class="block text-gray-700 mb-2">Artist / Photographer</label>
116
+ <input type="text" id="artistPhotog" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g., Greg Rutkowski, Artgerm">
117
+ </div>
118
+ </div>
119
+
120
+ <!-- NSFW Toggle -->
121
+ <div class="mb-6">
122
+ <label class="inline-flex items-center cursor-pointer">
123
+ <input type="checkbox" id="nsfwToggle" class="sr-only peer" onclick="toggleNsfwField()">
124
+ <div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-indigo-300 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-red-500"></div>
125
+ <span class="ms-3 text-sm font-medium text-gray-700">NSFW Content</span>
126
+ </label>
127
+ <div id="nsfwField" class="nsfw-field mt-3">
128
+ <label class="block text-gray-700 mb-2">NSFW Details</label>
129
+ <input type="text" id="nsfwDetails" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g., ((stockings and garters:1.4)), ((strategic shadows:1.3))">
130
+ </div>
131
+ </div>
132
+
133
+ <!-- Flavor Tags -->
134
+ <div class="mb-8">
135
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">Flavor Tags</h2>
136
+ <div class="flex flex-wrap gap-2">
137
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">voluptuous curves</span>
138
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">cosmic energy</span>
139
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">dreamlike quality</span>
140
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">otherworldly beauty</span>
141
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">golden hoop earrings</span>
142
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">salt-weathered skin</span>
143
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">vines creeping</span>
144
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">ethereal glow</span>
145
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">dynamic pose</span>
146
+ <span onclick="toggleTag(this)" class="flavor-tag px-3 py-1 bg-gray-200 rounded-full text-sm cursor-pointer">cinematic lighting</span>
147
+ </div>
148
+ </div>
149
+
150
+ <!-- Action Buttons -->
151
+ <div class="flex flex-wrap gap-4 justify-center mb-6">
152
+ <button onclick="generatePrompt()" class="px-6 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition flex items-center gap-2">
153
+ <i class="fas fa-magic"></i> Generate Prompt
154
+ </button>
155
+ <button onclick="surpriseMe()" class="px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition flex items-center gap-2">
156
+ <i class="fas fa-surprise"></i> Surprise Me!
157
+ </button>
158
+ <button onclick="copyToClipboard()" class="px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition flex items-center gap-2">
159
+ <i class="fas fa-copy"></i> Copy Prompt
160
+ </button>
161
+ <button onclick="clearForm()" class="px-6 py-3 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition flex items-center gap-2">
162
+ <i class="fas fa-broom"></i> Clear All
163
+ </button>
164
+ </div>
165
+
166
+ <!-- Generated Prompt -->
167
+ <div class="mb-8">
168
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">Generated Prompt</h2>
169
+ <div id="generatedPrompt" class="bg-gray-50 p-4 rounded-lg border border-gray-200 min-h-24 whitespace-pre-wrap"></div>
170
+ </div>
171
+ </div>
172
+
173
+ <!-- Prompt History -->
174
+ <div class="bg-white rounded-xl shadow-lg p-6">
175
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">Prompt History (Last 5)</h2>
176
+ <div id="promptHistory" class="space-y-3">
177
+ <!-- History items will be added here -->
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+
183
+ <script>
184
+ // Store the last 5 generated prompts
185
+ let promptHistory = [];
186
+ let selectedTags = [];
187
+
188
+ // Celebrity names for autocomplete
189
+ const celebrityNames = [
190
+ "Cherie Currie", "Candice Night", "Aimee Ann Duffy", "Agnetha Fältskog", "Lita Ford",
191
+ "Nina Gordon", "Sass Jordan", "Jan Kuehnemund", "Avril Lavigne", "Taylor Momsen",
192
+ "Stevie Nicks", "Emily Osment", "Orianthi Panagaris", "Doro Pesch", "Liz Phair",
193
+ "Michelle Phillips", "Suzi Quatro", "Otep Shamaya", "Gwen Stefani", "Joss Stone",
194
+ "Bonnie Tyler", "Gen Vincent", "Sandy West", "Torry Castellano", "Nancy Wilson",
195
+ "Mrs. Butterworth", "Aimee Lou Wood", "Angie Everhart", "Alexandra Daddario",
196
+ "Anna Kendrick", "Amber Heard", "April Bowlby", "Alice Eve", "Angelina Jolie",
197
+ "Alyson Hannigan", "Amy Adams", "Amanda Bynes", "Amy Smart", "Alison Brie",
198
+ "Ali Larter", "Anna Friel", "Andie MacDowell", "Anya Taylor-Joy", "Amanda Seyfried",
199
+ "Alexis Bledel", "Amanda Peet", "Bryce Dallas Howard", "Brittany Murphy",
200
+ "Brie Larson", "Bella Thorne", "Brooke Shields", "Betty Gilpin", "Barbara Palvin",
201
+ "Barbara Hershey", "Britt Ekland", "Barbi Benton", "Blake Lively", "Courteney Cox",
202
+ "Candice Cameron", "Chloë Grace Moretz", "Carmen Electra", "Cara Delevingne",
203
+ "Cameron Diaz", "Christina Applegate", "Cindy Crawford", "Dana Plato",
204
+ "Drew Barrymore", "Danielle Fishel", "Dakota Fanning", "Dakota Johnson",
205
+ "Demi Moore", "Elizabeth Banks", "Elisha Cuthbert", "Emma Watson",
206
+ "Evan Rachel Wood", "Elle Macpherson", "Elaine Irwin", "Elizabeth Berkley",
207
+ "Elizabeth Shue", "Emmy Rossum", "Emilia Clarke", "Emma Roberts", "Emma Stone",
208
+ "Elle Fanning", "Elizabeth Montgomery", "Gwen Stefani", "Gillian Anderson",
209
+ "Geena Davis", "Grace Phipps", "Giorga Whigham", "Gillian Jacobs", "Gal Gadot",
210
+ "Hailee Steinfeld", "Heather Thomas", "Helena Mattsson", "Halle Berry",
211
+ "Heather Locklear", "Isla Fisher", "Jennifer Aniston", "Justine Bateman",
212
+ "Jenna Fischer", "Jodi Foster", "Jenna Elfman", "Jessica Chastain",
213
+ "Jennifer Morrison", "Jenna Coleman", "Julia Roberts", "Jennifer Connelly",
214
+ "Julie Andrews", "Juliette Lewis", "Jennifer Tilly", "Julia Louis-Dreyfus",
215
+ "Jennifer Lawrence", "Janet Jackson", "Jessica Alba", "Jaime Pressly",
216
+ "Jessica Simpson", "Julia Stiles", "Keira Knightley", "Kate Mara",
217
+ "Katey Sagal", "Kate Upton", "Kathy Ireland", "Kaya Scodelario",
218
+ "Kirsten Dunst", "Kat Dennings", "Kristen Stewart", "Kate Beckinsale",
219
+ "Kaley Cuoco", "Kelly Lebrock", "Katheryn Winnick", "Katie Holmes",
220
+ "Kirstie Alley", "Leanna Decker", "Lisa Allison", "Lucy Lawless",
221
+ "Leelee Sobieski", "Lucy Hale", "Lori Loughlin", "Lake Bell", "Liv Tyler",
222
+ "Lindsay Lohan", "Lily Aldridge", "Lily Collins", "Lea Thompson",
223
+ "Leah Remini", "Michelle Mylett", "Margot Robbie", "Mischa Barton",
224
+ "Melanie Lynskey", "Milly Alcock", "Minka Kelly", "Melissa Fumero",
225
+ "Michelle Pfeiffer", "Mila Kunis", "Mia Sara", "Milla Jovovich",
226
+ "Markie Post", "Megyn Kelly", "Michelle Monaghan", "Mary Elizabeth Ellis",
227
+ "Marisa Tomei", "McKayla Maroney", "Natalie Zea", "Natalie Dormer",
228
+ "Natalia Dyer", "Nicole Kidman", "Nathalie Emmanuel", "Natalie Portman",
229
+ "Pamela Anderson", "Patricia Heaton", "Rachel McAdams", "Rashida Jones",
230
+ "Robin Givens", "Reese Witherspoon", "Sofia Vergara", "Stephanie Beatriz",
231
+ "Sharon Stone", "Sydney Sweeney", "Shakira", "Sheryl Crow",
232
+ "Sandra Bullock", "Scarlett Johansson", "Taylor Swift",
233
+ "Tiffani Amber Thiessen", "Wendy O Williams", "Winona Ryder",
234
+ "Holly Madison", "Bridget Marquardt", "Kendra Wilkinson",
235
+ "Kristina Shannon", "Karissa Shannon", "Abella Danger",
236
+ "Nicole Aniston", "Mia Malkova", "Riley Reid", "Mia Khalifa",
237
+ "Lena Anderson", "Lena Paul", "Heather Harmon"
238
+ ];
239
+
240
+ // Initialize autocomplete
241
+ function autocomplete(inp, arr) {
242
+ let currentFocus;
243
+
244
+ inp.addEventListener("input", function(e) {
245
+ let val = this.value;
246
+ closeAllLists();
247
+ if (!val) { return false; }
248
+ currentFocus = -1;
249
+
250
+ const list = document.createElement("DIV");
251
+ list.setAttribute("id", this.id + "autocomplete-list");
252
+ list.setAttribute("class", "autocomplete-items");
253
+ this.parentNode.appendChild(list);
254
+
255
+ for (let i = 0; i < arr.length; i++) {
256
+ if (arr[i].toUpperCase().includes(val.toUpperCase())) {
257
+ const item = document.createElement("DIV");
258
+ item.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
259
+ item.innerHTML += arr[i].substr(val.length);
260
+ item.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
261
+
262
+ item.addEventListener("click", function(e) {
263
+ inp.value = this.getElementsByTagName("input")[0].value;
264
+ closeAllLists();
265
+ });
266
+ list.appendChild(item);
267
+ }
268
+ }
269
+ });
270
+
271
+ inp.addEventListener("keydown", function(e) {
272
+ let x = document.getElementById(this.id + "autocomplete-list");
273
+ if (x) x = x.getElementsByTagName("div");
274
+ if (e.keyCode == 40) { // Down
275
+ currentFocus++;
276
+ addActive(x);
277
+ } else if (e.keyCode == 38) { // Up
278
+ currentFocus--;
279
+ addActive(x);
280
+ } else if (e.keyCode == 13) { // Enter
281
+ e.preventDefault();
282
+ if (currentFocus > -1) {
283
+ if (x) x[currentFocus].click();
284
+ }
285
+ }
286
+ });
287
+
288
+ function addActive(x) {
289
+ if (!x) return false;
290
+ removeActive(x);
291
+ if (currentFocus >= x.length) currentFocus = 0;
292
+ if (currentFocus < 0) currentFocus = (x.length - 1);
293
+ x[currentFocus].classList.add("autocomplete-active");
294
+ }
295
+
296
+ function removeActive(x) {
297
+ for (let i = 0; i < x.length; i++) {
298
+ x[i].classList.remove("autocomplete-active");
299
+ }
300
+ }
301
+
302
+ function closeAllLists(elmnt) {
303
+ const x = document.getElementsByClassName("autocomplete-items");
304
+ for (let i = 0; i < x.length; i++) {
305
+ if (elmnt != x[i] && elmnt != inp) {
306
+ x[i].parentNode.removeChild(x[i]);
307
+ }
308
+ }
309
+ }
310
+
311
+ document.addEventListener("click", function(e) {
312
+ closeAllLists(e.target);
313
+ });
314
+ }
315
+
316
+ // Initialize autocomplete on mainSubject input
317
+ document.addEventListener("DOMContentLoaded", function() {
318
+ autocomplete(document.getElementById("mainSubject"), celebrityNames);
319
+ });
320
+
321
+ // Toggle NSFW field visibility
322
+ function toggleNsfwField() {
323
+ const nsfwField = document.getElementById('nsfwField');
324
+ nsfwField.classList.toggle('visible');
325
+ if (nsfwField.classList.contains('visible')) {
326
+ nsfwField.style.maxHeight = nsfwField.scrollHeight + 'px';
327
+ } else {
328
+ nsfwField.style.maxHeight = '0';
329
+ }
330
+ }
331
+
332
+ // Toggle flavor tag selection
333
+ function toggleTag(element) {
334
+ element.classList.toggle('selected');
335
+ const tagText = element.textContent.trim();
336
+
337
+ if (element.classList.contains('selected')) {
338
+ if (!selectedTags.includes(tagText)) {
339
+ selectedTags.push(tagText);
340
+ }
341
+ } else {
342
+ selectedTags = selectedTags.filter(tag => tag !== tagText);
343
+ }
344
+ }
345
+
346
+ // Generate the final prompt
347
+ function generatePrompt() {
348
+ const mainSubject = document.getElementById('mainSubject').value;
349
+ const styleAppearance = document.getElementById('styleAppearance').value;
350
+ const characterDesc = document.getElementById('characterDesc').value;
351
+ const sceneDetails = document.getElementById('sceneDetails').value;
352
+ const techSettings = document.getElementById('techSettings').value;
353
+ const artistPhotog = document.getElementById('artistPhotog').value;
354
+ const nsfwDetails = document.getElementById('nsfwToggle').checked ? document.getElementById('nsfwDetails').value : '';
355
+
356
+ // Build the prompt parts
357
+ let promptParts = [
358
+ "score_9, score_8_up, score_7_up",
359
+ `"${mainSubject}"`,
360
+ styleAppearance,
361
+ characterDesc,
362
+ ...selectedTags,
363
+ sceneDetails
364
+ ];
365
+
366
+ // Add NSFW details if enabled
367
+ if (nsfwDetails) {
368
+ promptParts.push(nsfwDetails);
369
+ }
370
+
371
+ // Add artist and technical settings
372
+ if (artistPhotog) {
373
+ promptParts.push(artistPhotog);
374
+ }
375
+ if (techSettings) {
376
+ promptParts.push(techSettings);
377
+ }
378
+
379
+ // Filter out empty parts and join with commas
380
+ const fullPrompt = promptParts.filter(part => part.trim() !== '').join(', ');
381
+
382
+ // Display the generated prompt
383
+ document.getElementById('generatedPrompt').textContent = fullPrompt;
384
+
385
+ // Add to history
386
+ addToHistory(fullPrompt);
387
+ }
388
+
389
+ // Add prompt to history (max 5 items)
390
+ function addToHistory(prompt) {
391
+ promptHistory.unshift(prompt);
392
+ if (promptHistory.length > 5) {
393
+ promptHistory.pop();
394
+ }
395
+
396
+ // Update history display
397
+ const historyContainer = document.getElementById('promptHistory');
398
+ historyContainer.innerHTML = '';
399
+
400
+ promptHistory.forEach((item, index) => {
401
+ const historyItem = document.createElement('div');
402
+ historyItem.className = 'prompt-history-item bg-gray-50 p-3 rounded-lg border border-gray-200 cursor-pointer hover:shadow-sm';
403
+ historyItem.innerHTML = `
404
+ <div class="flex justify-between items-start">
405
+ <div class="text-sm text-gray-600">#${index + 1}</div>
406
+ <button onclick="copyHistoryItem(${index})" class="text-gray-400 hover:text-indigo-600">
407
+ <i class="fas fa-copy"></i>
408
+ </button>
409
+ </div>
410
+ <div class="text-gray-800 mt-1 text-sm whitespace-pre-wrap">${item}</div>
411
+ `;
412
+ historyItem.onclick = () => {
413
+ document.getElementById('generatedPrompt').textContent = item;
414
+ };
415
+ historyContainer.appendChild(historyItem);
416
+ });
417
+ }
418
+
419
+ // Copy history item to main prompt
420
+ function copyHistoryItem(index) {
421
+ event.stopPropagation();
422
+ document.getElementById('generatedPrompt').textContent = promptHistory[index];
423
+ }
424
+
425
+ // Copy generated prompt to clipboard
426
+ function copyToClipboard() {
427
+ const prompt = document.getElementById('generatedPrompt').textContent;
428
+ if (prompt.trim()) {
429
+ navigator.clipboard.writeText(prompt).then(() => {
430
+ alert('Prompt copied to clipboard!');
431
+ });
432
+ } else {
433
+ alert('No prompt to copy!');
434
+ }
435
+ }
436
+
437
+ // Clear all form fields
438
+ function clearForm() {
439
+ document.getElementById('mainSubject').value = '';
440
+ document.getElementById('styleAppearance').value = '';
441
+ document.getElementById('characterDesc').value = '';
442
+ document.getElementById('sceneDetails').value = '';
443
+ document.getElementById('techSettings').value = '';
444
+ document.getElementById('artistPhotog').value = '';
445
+ document.getElementById('nsfwDetails').value = '';
446
+ document.getElementById('nsfwToggle').checked = false;
447
+ toggleNsfwField();
448
+
449
+ // Clear selected tags
450
+ selectedTags = [];
451
+ document.querySelectorAll('.flavor-tag').forEach(tag => {
452
+ tag.classList.remove('selected');
453
+ });
454
+
455
+ document.getElementById('generatedPrompt').textContent = '';
456
+ }
457
+
458
+ // Apply theme presets
459
+ function applyTheme(theme) {
460
+ const isNsfw = document.getElementById('nsfwToggle').checked;
461
+
462
+ const themes = {
463
+ rockstar: {
464
+ mainSubject: "Lead singer of a rock band",
465
+ styleAppearance: "high contrast, dramatic lighting, leather jacket",
466
+ characterDesc: "wild hair, intense gaze, microphone in hand",
467
+ sceneDetails: "concert stage, smoke machines, laser lights",
468
+ techSettings: "--ar 16:9 --ISO 1600 --aperture f/1.8",
469
+ artistPhotog: "Annie Leibovitz, Mick Rock",
470
+ nsfwDetails: isNsfw ? "((sweaty skin:1.2)), ((ripped shirt:1.3))" : ""
471
+ },
472
+ vintage: {
473
+ mainSubject: "1950s couple",
474
+ styleAppearance: "Kodachrome film, faded colors, grainy texture",
475
+ characterDesc: "retro fashion, classic hairstyles, nostalgic expression",
476
+ sceneDetails: "diner booth, jukebox in background, neon sign",
477
+ techSettings: "--ar 4:3 --v 5",
478
+ artistPhotog: "Saul Leiter, Vivian Maier",
479
+ nsfwDetails: isNsfw ? "((rolled up sleeves:1.1)), ((lipstick mark on cheek:1.2))" : ""
480
+ },
481
+ fun: {
482
+ mainSubject: "Group of friends at a carnival",
483
+ styleAppearance: "bright colors, pop art style, comic book aesthetic",
484
+ characterDesc: "laughing, cotton candy, oversized sunglasses",
485
+ sceneDetails: "ferris wheel in background, balloon animals, confetti",
486
+ techSettings: "--ar 1:1 --q 2",
487
+ artistPhotog: "Takashi Murakami, Yayoi Kusama",
488
+ nsfwDetails: isNsfw ? "((silly faces:1.1)), ((food fight:1.3))" : ""
489
+ },
490
+ erotic: {
491
+ mainSubject: "Seductive figure in lingerie",
492
+ styleAppearance: "soft focus, chiaroscuro lighting, sensual",
493
+ characterDesc: "alluring gaze, elegant pose, flawless skin",
494
+ sceneDetails: "luxury bedroom, silk sheets, candlelight",
495
+ techSettings: "--ar 9:16 --style 4b",
496
+ artistPhotog: "Helmut Newton, Ellen von Unwerth",
497
+ nsfwDetails: isNsfw ? "((strategic shadows:1.4)), ((pearl necklace:1.3)), ((stockings:1.5))" : ""
498
+ },
499
+ surreal: {
500
+ mainSubject: "Floating figure in space",
501
+ styleAppearance: "dreamlike, impossible perspective, vibrant colors",
502
+ characterDesc: "body made of constellations, third eye, elongated limbs",
503
+ sceneDetails: "surreal landscape, floating islands, giant clock",
504
+ techSettings: "--ar 3:2 --chaos 20",
505
+ artistPhotog: "Salvador Dalí, René Magritte",
506
+ nsfwDetails: isNsfw ? "((translucent skin:1.2)), ((cosmic energy flowing:1.4))" : ""
507
+ }
508
+ };
509
+
510
+ const selectedTheme = themes[theme];
511
+
512
+ document.getElementById('mainSubject').value = selectedTheme.mainSubject;
513
+ document.getElementById('styleAppearance').value = selectedTheme.styleAppearance;
514
+ document.getElementById('characterDesc').value = selectedTheme.characterDesc;
515
+ document.getElementById('sceneDetails').value = selectedTheme.sceneDetails;
516
+ document.getElementById('techSettings').value = selectedTheme.techSettings;
517
+ document.getElementById('artistPhotog').value = selectedTheme.artistPhotog;
518
+
519
+ if (isNsfw) {
520
+ document.getElementById('nsfwDetails').value = selectedTheme.nsfwDetails;
521
+ }
522
+
523
+ // Update flavor tags based on theme
524
+ selectedTags = [];
525
+ document.querySelectorAll('.flavor-tag').forEach(tag => {
526
+ tag.classList.remove('selected');
527
+ });
528
+
529
+ // Add some theme-appropriate flavor tags
530
+ const themeTags = {
531
+ rockstar: ["voluptuous curves", "dynamic pose", "golden hoop earrings"],
532
+ vintage: ["salt-weathered skin", "ethereal glow", "vines creeping"],
533
+ fun: ["dreamlike quality", "cinematic lighting"],
534
+ erotic: ["voluptuous curves", "golden hoop earrings"],
535
+ surreal: ["cosmic energy", "otherworldly beauty", "dreamlike quality"]
536
+ };
537
+
538
+ themeTags[theme].forEach(tagText => {
539
+ const tags = document.querySelectorAll('.flavor-tag');
540
+ for (let tag of tags) {
541
+ if (tag.textContent.trim() === tagText) {
542
+ tag.classList.add('selected');
543
+ selectedTags.push(tagText);
544
+ break;
545
+ }
546
+ }
547
+ });
548
+ }
549
+
550
+ // Surprise me! - Randomly fill all fields
551
+ function surpriseMe() {
552
+ const isNsfw = document.getElementById('nsfwToggle').checked;
553
+
554
+ // Random subjects
555
+ const subjects = [
556
+ "Mysterious woman in a red dress",
557
+ "Cyberpunk hacker",
558
+ "Ancient warrior queen",
559
+ "Steampunk inventor",
560
+ "Elven archer",
561
+ "Space explorer",
562
+ "Underwater mermaid",
563
+ "Post-apocalyptic survivor",
564
+ "Time traveler",
565
+ "Magical girl",
566
+ // Add some random celebrity names
567
+ celebrityNames[Math.floor(Math.random() * celebrityNames.length)],
568
+ celebrityNames[Math.floor(Math.random() * celebrityNames.length)],
569
+ celebrityNames[Math.floor(Math.random() * celebrityNames.length)]
570
+ ];
571
+
572
+ // Random styles
573
+ const styles = [
574
+ "watercolor painting",
575
+ "hyperrealistic photography",
576
+ "anime style",
577
+ "oil painting",
578
+ "digital art",
579
+ "pencil sketch",
580
+ "3D render",
581
+ "low poly",
582
+ "impressionist",
583
+ "surrealist"
584
+ ];
585
+
586
+ // Random character descriptions
587
+ const charDescs = [
588
+ "with glowing tattoos",
589
+ "wearing a futuristic visor",
590
+ "surrounded by floating objects",
591
+ "with heterochromatic eyes",
592
+ "as a celestial being",
593
+ "with mechanical limbs",
594
+ "drenched in golden light",
595
+ "with an aura of mystery",
596
+ "as a mythical creature",
597
+ "with an ancient artifact"
598
+ ];
599
+
600
+ // Random scene details
601
+ const sceneDetails = [
602
+ "ancient ruins at sunset",
603
+ "neon-lit city streets",
604
+ "floating islands in the sky",
605
+ "undersea coral palace",
606
+ "desert wasteland",
607
+ "enchanted forest",
608
+ "space station interior",
609
+ "Victorian era ballroom",
610
+ "post-apocalyptic cityscape",
611
+ "magical academy library"
612
+ ];
613
+
614
+ // Updated Random technical settings with new options
615
+ const techSettings = [
616
+ "dslr, soft lighting, high quality, film grain",
617
+ "Fujifilm XT3, cinematic lighting, gloomy, dark",
618
+ "dimmed, RAW photo, vignette photography, slate atmosphere",
619
+ "more details, intricate texture, 16k, highly detailed hair",
620
+ "(photorealistic), bright floodlights in background, raining",
621
+ "night time, soft focus, 55mm lens, f/2.8",
622
+ "insanely detailed, highest quality, cinematic film still",
623
+ "cinematic lighting, vibrant, --style expressive",
624
+ "amateur candid photography, evocative pose, 4k",
625
+ "sharp focus, masterpiece, award winning photo",
626
+ "cinestill 800, (hyperrealism:1.2), (8K UHD:1.2)",
627
+ "(photorealistic:1.2), shot with hasselblad H6D",
628
+ "20 megapixel, canon eos r3, nikon d850",
629
+ "film stock photograph, 4 kodak portra 400",
630
+ "camera f1.6 lens, (dramatic lighting)",
631
+ "lifelike texture, highly detailed skin",
632
+ "--ar 16:9 --ISO 400",
633
+ "--ar 4:3 --v 5",
634
+ "--ar 1:1 --q 2",
635
+ "--ar 9:16 --style 4b",
636
+ "--ar 3:2 --chaos 20",
637
+ "--ar 2:3 --stylize 1000",
638
+ "--ar 5:4 --seed 1234",
639
+ "--ar 7:5 --tile",
640
+ "--ar 21:9 --testp",
641
+ "--ar 3:4 --upbeta"
642
+ ];
643
+
644
+ // Random artists
645
+ const artists = [
646
+ "Greg Rutkowski",
647
+ "Artgerm",
648
+ "Alphonse Mucha",
649
+ "H.R. Giger",
650
+ "Zdzisław Beksiński",
651
+ "Moebius",
652
+ "Yoshitaka Amano",
653
+ "Frank Frazetta",
654
+ "Boris Vallejo",
655
+ "Julie Bell"
656
+ ];
657
+
658
+ // Random NSFW details
659
+ const nsfwDetails = [
660
+ "((stockings and garters:1.4))",
661
+ "((strategic shadows:1.3))",
662
+ "((pearl necklace between breasts:1.2))",
663
+ "((silk robe slipping off:1.3))",
664
+ "((wet fabric clinging:1.4))",
665
+ "((biting lower lip:1.2))",
666
+ "((back arch:1.3))",
667
+ "((thigh highs:1.4))",
668
+ "((corset laces:1.3))",
669
+ "((choker necklace:1.2))"
670
+ ];
671
+
672
+ // Random flavor tags
673
+ const allFlavorTags = [
674
+ "voluptuous curves",
675
+ "cosmic energy",
676
+ "dreamlike quality",
677
+ "otherworldly beauty",
678
+ "golden hoop earrings",
679
+ "salt-weathered skin",
680
+ "vines creeping",
681
+ "ethereal glow",
682
+ "dynamic pose",
683
+ "cinematic lighting",
684
+ "mysterious aura",
685
+ "futuristic aesthetic",
686
+ "ancient wisdom",
687
+ "magical essence",
688
+ "technological marvel"
689
+ ];
690
+
691
+ // Select random items
692
+ const randomSubject = subjects[Math.floor(Math.random() * subjects.length)];
693
+ const randomStyle = styles[Math.floor(Math.random() * styles.length)];
694
+ const randomCharDesc = charDescs[Math.floor(Math.random() * charDescs.length)];
695
+ const randomScene = sceneDetails[Math.floor(Math.random() * sceneDetails.length)];
696
+ const randomTech = techSettings[Math.floor(Math.random() * techSettings.length)];
697
+ const randomArtist = artists[Math.floor(Math.random() * artists.length)];
698
+ const randomNsfw = isNsfw ? nsfwDetails[Math.floor(Math.random() * nsfwDetails.length)] + ", " + nsfwDetails[Math.floor(Math.random() * nsfwDetails.length)] : '';
699
+
700
+ // Select 3-5 random flavor tags
701
+ selectedTags = [];
702
+ const numTags = 3 + Math.floor(Math.random() * 3);
703
+ const shuffledTags = [...allFlavorTags].sort(() => 0.5 - Math.random());
704
+ selectedTags = shuffledTags.slice(0, numTags);
705
+
706
+ // Update form fields
707
+ document.getElementById('mainSubject').value = randomSubject;
708
+ document.getElementById('styleAppearance').value = randomStyle;
709
+ document.getElementById('characterDesc').value = randomCharDesc;
710
+ document.getElementById('sceneDetails').value = randomScene;
711
+ document.getElementById('techSettings').value = randomTech;
712
+ document.getElementById('artistPhotog').value = randomArtist;
713
+
714
+ if (isNsfw) {
715
+ document.getElementById('nsfwDetails').value = randomNsfw;
716
+ }
717
+
718
+ // Update flavor tag UI
719
+ document.querySelectorAll('.flavor-tag').forEach(tag => {
720
+ tag.classList.remove('selected');
721
+ if (selectedTags.includes(tag.textContent.trim())) {
722
+ tag.classList.add('selected');
723
+ }
724
+ });
725
+
726
+ // Generate the prompt immediately
727
+ generatePrompt();
728
+ }
729
+ </script>
730
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Scartxx/text-to-image-prompt-generator" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
731
+ </html>