File size: 11,888 Bytes
ec1f820
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Stable Diffusion Prompt Generator</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .dropdown {
            position: relative;
            display: inline-block;
        }
        
        .dropdown-content {
            display: none;
            position: absolute;
            background-color: #f9f9f9;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
            z-index: 1;
            max-height: 200px;
            overflow-y: auto;
            border-radius: 0.5rem;
        }
        
        .dropdown:hover .dropdown-content {
            display: block;
        }
        
        .dropdown-item {
            color: black;
            padding: 8px 16px;
            text-decoration: none;
            display: block;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .dropdown-item:hover {
            background-color: #e2e8f0;
        }
        
        .dropdown-item.empty {
            color: #999;
            font-style: italic;
        }
        
        .highlight {
            background-color: #fef08a;
            padding: 0 2px;
            border-radius: 4px;
            transition: all 0.2s;
        }
        
        .highlight.empty {
            background-color: #fee2e2;
            text-decoration: line-through;
        }
        
        .highlight:hover {
            background-color: #fde047;
            cursor: pointer;
        }
        
        #promptDisplay {
            min-height: 100px;
            border: 1px solid #e2e8f0;
            border-radius: 0.5rem;
            padding: 1rem;
            background-color: #f8fafc;
            white-space: pre-wrap;
        }
        
        .copy-btn {
            transition: all 0.2s;
        }
        
        .copy-btn:hover {
            transform: scale(1.05);
        }
        
        .copy-btn.copied {
            background-color: #10b981 !important;
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen p-6">
    <div class="max-w-4xl mx-auto">
        <div class="text-center mb-8">
            <h1 class="text-3xl font-bold text-indigo-700 mb-2">Stable Diffusion Prompt Generator</h1>
            <p class="text-gray-600">Build your perfect prompt by selecting alternatives for each word</p>
        </div>
        
            
            <div class="mb-6">
                <h2 class="text-xl font-semibold text-gray-800 mb-4">Customize Your Prompt:</h2>
                <div id="wordSelectors" class="flex flex-wrap gap-2 mb-4">
                    <!-- Word selectors will be inserted here -->
                </div>
            </div>
            
            <div class="mb-6">
                <h2 class="text-xl font-semibold text-gray-800 mb-4">Your Generated Prompt:</h2>
                <div id="promptDisplay" class="mb-4"></div>
                <button id="copyBtn" class="copy-btn bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-4 rounded-lg flex items-center justify-center gap-2">
                    <i class="fas fa-copy"></i>
                    <span>Copy to Clipboard</span>
                </button>
            </div>
        </div>
        
        <div class="text-center text-gray-500 text-sm">
            <p>Tip: Hover over any word to see alternative options. Select the empty option to remove a word.</p>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Original prompt words with alternatives
            const promptWords = [
                {
                    word: "a",
                    type: "article",
                    alternatives: ["a", "an", "the", "some", "two", "three", "several", "many"]
                },
                {
                    word: "pair",
                    type: "quantity",
                    alternatives: ["pair", "couple", "duo", "twosome", "two", "few", "group of", "several"]
                },
                {
                    word: "of",
                    type: "preposition",
                    alternatives: ["of", "with", "and", "featuring", "including"]
                },
                {
                    word: "energetic",
                    type: "adjective",
                    alternatives: ["energetic", "playful", "lively", "cheerful", "vibrant", "dynamic", "active", "spirited"]
                },
                {
                    word: "charming",
                    type: "adjective",
                    alternatives: ["charming", "adorable", "cute", "sweet", "lovely", "endearing", "delightful", "appealing"]
                },
                {
                    word: "18-yo",
                    type: "age",
                    alternatives: ["18-yo", "17-yo", "16-yo", "15-yo", "14-yo", "13-yo", "12-yo", "11-yo", "10-yo", "12-yo", "young", "preteen", "teenage", "adolescent", "child"]
                },
                {
                    word: "naturalist",
                    type: "adjective",
                    alternatives: ["nudist", "naked", "bare", "unclothed", "clothes-free", "naturalist", "topless", "partially clothed"]
                },
                {
                    word: "girls",
                    type: "noun",
                    alternatives: ["girls", "children", "kids", "teens", "youngsters", "siblings", "friends", "twins"]
                },
                {
                    word: "kissing",
                    type: "verb",
                    alternatives: ["kissing", "hugging", "embracing", "holding", "touching", "caressing", "playing with", "interacting with"]
                },
                {
                    word: "an",
                    type: "article",
                    alternatives: ["a", "an", "the", "their", "some", "another"]
                },
                {
                    word: "older",
                    type: "adjective",
                    alternatives: ["older", "younger", "same-age", "teenage", "adult", "mature", "elder", "senior"]
                },
                {
                    word: "friend",
                    type: "noun",
                    alternatives: ["friend", "sister", "brother", "mother", "father", "companion", "peer", "relative"]
                },
                {
                    word: "running",
                    type: "verb",
                    alternatives: ["running", "walking", "playing", "dancing", "jumping", "laughing", "smiling", "exploring"]
                },
                {
                    word: "in",
                    type: "preposition",
                    alternatives: ["in", "on", "at", "through", "amidst", "among", "by", "near"]
                },
                {
                    word: "nature",
                    type: "noun",
                    alternatives: ["nature", "the forest", "the meadow", "the beach", "the park", "the wilderness", "the countryside", "the garden"]
                } 
            ];

            const wordSelectors = document.getElementById('wordSelectors');
            const promptDisplay = document.getElementById('promptDisplay');
            const copyBtn = document.getElementById('copyBtn');
            
            let currentPrompt = promptWords.map(item => item.word);
            
            // Create word selectors
            promptWords.forEach((wordObj, index) => {
                const dropdown = document.createElement('div');
                dropdown.className = 'dropdown';
                
                const span = document.createElement('span');
                span.className = 'highlight';
                span.textContent = wordObj.word;
                span.title = `Click to change (${wordObj.type})`;
                
                const dropdownContent = document.createElement('div');
                dropdownContent.className = 'dropdown-content';
                
                // Add empty option first
                const emptyItem = document.createElement('div');
                emptyItem.className = 'dropdown-item empty';
                emptyItem.textContent = '(remove)';
                emptyItem.addEventListener('click', () => {
                    updatePrompt(index, '');
                    span.textContent = '';
                    span.classList.add('empty');
                });
                dropdownContent.appendChild(emptyItem);
                
                // Add other alternatives
                wordObj.alternatives.forEach(alt => {
                    const item = document.createElement('div');
                    item.className = 'dropdown-item';
                    item.textContent = alt;
                    item.addEventListener('click', () => {
                        updatePrompt(index, alt);
                        span.textContent = alt;
                        span.classList.remove('empty');
                    });
                    dropdownContent.appendChild(item);
                });
                
                dropdown.appendChild(span);
                dropdown.appendChild(dropdownContent);
                wordSelectors.appendChild(dropdown);
                
                // Add space after each word except the last one
                if (index < promptWords.length - 1) {
                    const space = document.createElement('span');
                    space.textContent = ' ';
                    wordSelectors.appendChild(space);
                }
            });
            
            // Function to update the prompt
            function updatePrompt(index, newWord) {
                currentPrompt[index] = newWord;
                renderPrompt();
            }
            
            // Function to render the prompt display
            function renderPrompt() {
                // Filter out empty words and join with spaces
                const filteredPrompt = currentPrompt.filter(word => word.trim() !== '');
                promptDisplay.textContent = filteredPrompt.join(' ') + (filteredPrompt.length > 0 ? '.' : '');
            }
            
            // Initial render
            renderPrompt();
            
            // Copy to clipboard functionality
            copyBtn.addEventListener('click', () => {
                const promptText = promptDisplay.textContent;
                navigator.clipboard.writeText(promptText).then(() => {
                    copyBtn.classList.add('copied');
                    copyBtn.innerHTML = '<i class="fas fa-check"></i><span>Copied!</span>';
                    setTimeout(() => {
                        copyBtn.classList.remove('copied');
                        copyBtn.innerHTML = '<i class="fas fa-copy"></i><span>Copy to Clipboard</span>';
                    }, 2000);
                });
            });
        });
    </script>
<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=MarkTheArtist/stable-diffusion-builder" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>