ivanoctaviogaitansantos commited on
Commit
122a610
·
verified ·
1 Parent(s): 77356ba

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +675 -0
app.py ADDED
@@ -0,0 +1,675 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import random
3
+ from typing import Dict, Any, List
4
+ import json
5
+ import datetime
6
+
7
+ class HyperRealisticConfig:
8
+ ETHNICITIES = [
9
+ "Mediterranean", "Scandinavian", "Slavic", "Latin American",
10
+ "Middle Eastern", "East Asian", "South Asian", "African",
11
+ "Caribbean", "Polynesian", "Mixed Heritage"
12
+ ]
13
+
14
+ BODY_TYPES = [
15
+ "athletic slender", "voluptuous curves", "petite feminine",
16
+ "toned hourglass", "soft natural", "elegant tall"
17
+ ]
18
+
19
+ SKIN_DETAILS = [
20
+ "with subtle freckles and skin texture", "with dewy natural complexion",
21
+ "showing realistic skin pores and veins", "with natural skin imperfections",
22
+ "with subsurface scattering effect", "with delicate skin translucency"
23
+ ]
24
+
25
+ PROFESSIONAL_ROLES = [
26
+ {
27
+ "role": "Executive Secretary",
28
+ "uniform": "form-fitting tailored black dress with silk blouse slightly unbuttoned",
29
+ "environment": "luxurious corporate office with marble floors",
30
+ "accessories": "slim tablet and leather portfolio",
31
+ "pose": "bending over conference table arranging documents"
32
+ },
33
+ {
34
+ "role": "Luxury Hotel Manager",
35
+ "uniform": "elegant navy blue blazer and pencil skirt riding up when seated",
36
+ "environment": "five-star hotel lobby with golden lighting",
37
+ "accessories": "gold name tag and master key cards",
38
+ "pose": "leaning forward to assist guest at reception"
39
+ },
40
+ {
41
+ "role": "Fashion Boutique Manager",
42
+ "uniform": "chic black designer dress with elegant draping that accents curves",
43
+ "environment": "high-end boutique with minimalist decor and spotlights",
44
+ "accessories": "designer handbag and inventory clipboard",
45
+ "pose": "kneeling to adjust mannequin display"
46
+ },
47
+ {
48
+ "role": "Corporate Lawyer",
49
+ "uniform": "sharp charcoal gray pantsuit with skirt hiking up when walking",
50
+ "environment": "modern law firm with floor-to-ceiling windows",
51
+ "accessories": "leather briefcase and legal documents",
52
+ "pose": "stretching to reach high shelf in law library"
53
+ },
54
+ {
55
+ "role": "Private Jet Attendant",
56
+ "uniform": "custom-fitted aviation uniform with skirt shortening when bending",
57
+ "environment": "luxurious private jet cabin with leather seats",
58
+ "accessories": "champagne flute and service tray",
59
+ "pose": "bending to serve passengers in low cabin"
60
+ },
61
+ {
62
+ "role": "Art Gallery Curator",
63
+ "uniform": "sleek black turtleneck and high-waisted trousers with visible panty lines",
64
+ "environment": "contemporary art gallery with dramatic lighting",
65
+ "accessories": "curator's catalog and white gloves",
66
+ "pose": "squatting to examine lower artwork"
67
+ },
68
+ {
69
+ "role": "University Professor",
70
+ "uniform": "elegant tweed blazer and knee-length skirt that rides up when seated",
71
+ "environment": "university library with wooden ladders",
72
+ "accessories": "academic books and reading glasses",
73
+ "pose": "reaching for book on high shelf"
74
+ },
75
+ {
76
+ "role": "Ballet Instructor",
77
+ "uniform": "black leotard with wrap skirt and visible dance belt lines",
78
+ "environment": "dance studio with wall mirrors and barre",
79
+ "accessories": "pointe shoe ribbon and demonstration stick",
80
+ "pose": "demonstrating deep plié at barre"
81
+ },
82
+ {
83
+ "role": "Yacht Stewardess",
84
+ "uniform": "crisp white polo and navy shorts that tighten when bending",
85
+ "environment": "luxury yacht deck at sunset with teak flooring",
86
+ "accessories": "silver tray with cocktails and nautical rope",
87
+ "pose": "leaning over side to adjust fenders"
88
+ },
89
+ {
90
+ "role": "Elegant Maid",
91
+ "uniform": "classic black maid dress with white lace apron that flips up",
92
+ "environment": "opulent mansion hallway with grand staircase",
93
+ "accessories": "feather duster and cleaning cart",
94
+ "pose": "bending to polish banister"
95
+ }
96
+ ]
97
+
98
+ EVERYDAY_MOMENTS = [
99
+ {
100
+ "scene": "Morning Kitchen",
101
+ "action": "bending down to take something from the low oven causing shirt to rise",
102
+ "outfit": "oversized white t-shirt and cotton shorts with visible panty lines",
103
+ "setting": "sunlit kitchen with open window and morning light",
104
+ "accessories": "coffee mug on counter, apron hanging, fresh herbs",
105
+ "pose": "natural bending with back arched"
106
+ },
107
+ {
108
+ "scene": "Laundry Room",
109
+ "action": "bending over to take clothes from the dryer showing waistband",
110
+ "outfit": "sports top and fitted leggings with subtle sheer panels",
111
+ "setting": "laundry room with baskets and folding table",
112
+ "accessories": "basket of clean clothes, fabric softener",
113
+ "pose": "deep forward bend with legs straight"
114
+ },
115
+ {
116
+ "scene": "Gardening",
117
+ "action": "kneeling while planting flowers with shorts riding up",
118
+ "outfit": "light cotton sundress with thin straps and no bra lines",
119
+ "setting": "backyard garden with flower pots and watering system",
120
+ "accessories": "gardening gloves, watering can, trowel",
121
+ "pose": "kneeling with one leg forward"
122
+ },
123
+ {
124
+ "scene": "Home Yoga",
125
+ "action": "doing downward dog pose with leggings becoming translucent",
126
+ "outfit": "yoga leggings and crop top with sweat patches",
127
+ "setting": "living room with yoga mat and natural side lighting",
128
+ "accessories": "yoga block, water bottle, meditation app",
129
+ "pose": "inverted V-shape with head down"
130
+ },
131
+ {
132
+ "scene": "Shelf Cleaning",
133
+ "action": "stretching on tiptoes to reach a book showing midriff",
134
+ "outfit": "loose t-shirt and pajama shorts with lace trim visible",
135
+ "setting": "personal library with small ladder and dust particles",
136
+ "accessories": "feather duster, stack of books, reading glasses",
137
+ "pose": "full body stretch on toes"
138
+ },
139
+ {
140
+ "scene": "Dog Walk",
141
+ "action": "bending down to attach the leash with dress gaping",
142
+ "outfit": "floral summer dress with thin fabric blowing in wind",
143
+ "setting": "park at sunset with long shadows and golden hour",
144
+ "accessories": "leash, treat pouch, dog water bottle",
145
+ "pose": "squatting while holding excited dog"
146
+ },
147
+ {
148
+ "scene": "Terrace Coffee",
149
+ "action": "sitting with legs crossed, dropping a napkin and reaching",
150
+ "outfit": "silk blouse and pleated skirt that opens when seated",
151
+ "setting": "terrace with iron table and morning mist",
152
+ "accessories": "open book, tea cup, croissant",
153
+ "pose": "leaning forward from seated position"
154
+ },
155
+ {
156
+ "scene": "Climbing Stairs",
157
+ "action": "going up with shopping bags showing back view",
158
+ "outfit": "pencil skirt and fitted blouse with tension lines",
159
+ "setting": "spiral staircase in apartment with dramatic lighting",
160
+ "accessories": "shopping bags, keys in hand, mail",
161
+ "pose": "mid-step with weight on one leg"
162
+ },
163
+ {
164
+ "scene": "Changing Lightbulb",
165
+ "action": "standing on a chair with arms raised fully",
166
+ "outfit": "long t-shirt as dress with back lift when reaching",
167
+ "setting": "kitchen with pendant light and afternoon shadows",
168
+ "accessories": "new lightbulb, step stool, tool box",
169
+ "pose": "tiptoes on chair reaching upward"
170
+ },
171
+ {
172
+ "scene": "Post-Shower",
173
+ "action": "drying hair with towel that keeps slipping",
174
+ "outfit": "short towel wrapped tightly with damp edges",
175
+ "setting": "bathroom with foggy mirror and steam effect",
176
+ "accessories": "hairdryer, bathrobe on hook, skincare products",
177
+ "pose": "bent forward hair drying motion"
178
+ }
179
+ ]LACE_BIKINI_STYLES = [
180
+ "delicate black lace bikini with floral embroidery and sheer panels",
181
+ "sheer nude illusion bikini with scalloped lace edges and ribbon ties",
182
+ "burgundy silk bikini with Chantilly lace inserts and satin strings",
183
+ "ivory French lace bikini with pearl accents and delicate stitching",
184
+ "champagne colored lace bikini with geometric patterns and silk backing",
185
+ "deep emerald lace bikini with velvet trim and adjustable sides",
186
+ "rose gold metallic lace bikini with transparent mesh panels",
187
+ "midnight blue lace bikini with crystal beading and underwire support"
188
+ ]
189
+
190
+ HOSIERY_STYLES = [
191
+ "black sheer thigh-high stockings with lace tops and stay-up silicone",
192
+ "nude ultra-sheer stockings with reinforced toes and back seam",
193
+ "fishnet thigh-highs with delicate diamond pattern and satin band",
194
+ "back-seam stockings with Cuban heel and vintage reinforcement",
195
+ "sheer to waist stockings with lace panel and no panty line",
196
+ "opaque tights with subtle sheen and reinforced gusset",
197
+ "stay-up stockings with French lace band and bow details",
198
+ "glossy finish stockings with sandalwood foot and sheer legs"
199
+ ]
200
+
201
+ HEEL_STYLES = [
202
+ "black patent leather stilettos with pointed toe and slim heel",
203
+ "nude pumps with platform and ankle strap for stability",
204
+ "gold strappy sandals with multiple thin straps and high arch",
205
+ "black suede pointed-toe heels with cut-out details",
206
+ "red bottom Louboutin-style heels with glossy finish",
207
+ "clear PVC heels with geometric shapes and metallic accents",
208
+ "silver glitter block heels with ankle support and comfort垫",
209
+ "white leather slingbacks with kitten heel and bow detail"
210
+ ]
211
+
212
+ HAIRSTYLES = [
213
+ "long wavy hair with natural volume and soft highlights",
214
+ "sleek straight hair with middle part and glossy finish",
215
+ "elegant updo with loose tendrils and pearl pins",
216
+ "beach waves with sun-kissed highlights and textured ends",
217
+ "high ponytail with smooth finish and subtle curls",
218
+ "braided crown with floral accents and soft flyaways",
219
+ "vintage Hollywood curls with deep side part",
220
+ "messy bun with face-framing strands and natural texture"
221
+ ]
222
+
223
+ MAKEUP_STYLES = [
224
+ "natural glam with dewy skin, soft contour, and nude lips",
225
+ "smoky eye with winged liner and voluminous lashes",
226
+ "rosy cheeks with glossy lips and subtle highlighter",
227
+ "bold red lip with flawless matte foundation",
228
+ "bronzed goddess with shimmery eyeshadow and golden highlights",
229
+ "minimalist makeup with tinted moisturizer and mascara",
230
+ "vintage pin-up with defined brows and classic red lip",
231
+ "ethereal glow with iridescent highlighter and soft blush"
232
+ ]
233
+
234
+ LIGHTING_DETAILS = [
235
+ "soft diffused lighting with a warm golden glow",
236
+ "dramatic chiaroscuro lighting with deep shadows",
237
+ "natural sunlight filtering through sheer curtains",
238
+ "studio lighting with a three-point setup for dimensionality",
239
+ "candlelit ambiance with flickering shadows",
240
+ "backlit silhouette with a soft halo effect",
241
+ "moody blue-toned lighting for a cinematic feel",
242
+ "sunset glow with lens flare and warm hues"
243
+ ]
244
+
245
+ PHOTOGRAPHY_STYLES = [
246
+ "cinematic lighting with rim light and soft shadows",
247
+ "natural window light with lens flare and soft focus",
248
+ "studio softbox lighting with catchlights in eyes",
249
+ "golden hour backlighting with hair light effect",
250
+ "moody low-key lighting with dramatic contrasts",
251
+ "bright high-key lighting with minimal shadows",
252
+ "film noir inspired lighting with venetian blind patterns",
253
+ "ethereal foggy lighting with diffusion filter"
254
+ ]
255
+
256
+ CAMERAS = ["Canon EOS R5", "Sony α7R V", "Nikon Z9", "Hasselblad X2D", "Phase One IQ4"]
257
+ LENSES = ["85mm f/1.2", "50mm f/1.4", "24-70mm f/2.8", "100mm f/2.8 macro", "135mm f/1.8"]class HyperRealisticPromptGenerator:
258
+ def __init__(self):
259
+ self.config = HyperRealisticConfig()
260
+ self.history: List[Dict] = []
261
+
262
+ def _get_role_by_name(self, name: str) -> Dict:
263
+ return next((r for r in self.config.PROFESSIONAL_ROLES if r["role"] == name), self.config.PROFESSIONAL_ROLES[0])
264
+
265
+ def _get_moment_by_name(self, name: str) -> Dict:
266
+ return next((m for m in self.config.EVERYDAY_MOMENTS if m["scene"] == name), self.config.EVERYDAY_MOMENTS[0])
267
+
268
+ def _random_style(self):
269
+ return (
270
+ random.choice(self.config.BODY_TYPES),
271
+ random.choice(self.config.SKIN_DETAILS),
272
+ random.choice(self.config.LACE_BIKINI_STYLES),
273
+ random.choice(self.config.HOSIERY_STYLES),
274
+ random.choice(self.config.HEEL_STYLES),
275
+ random.choice(self.config.HAIRSTYLES),
276
+ random.choice(self.config.MAKEUP_STYLES),
277
+ random.choice(self.config.LIGHTING_DETAILS),
278
+ random.choice(self.config.PHOTOGRAPHY_STYLES),
279
+ random.choice(self.config.CAMERAS),
280
+ random.choice(self.config.LENSES)
281
+ )
282
+
283
+ def generate_role_prompt(self, ethnicity: str, role_name: str, nsfw_mode: bool = False) -> str:
284
+ role = self._get_role_by_name(role_name)
285
+ body, skin, lace, hosiery, heels, hairstyle, makeup, lighting, photo_style, camera, lens = self._random_style()
286
+
287
+ if nsfw_mode:
288
+ reveal = f"subtle reveal of {lace} through clothing during {role['pose']}"
289
+ underwear_desc = f"wearing {lace} under {role['uniform']}"
290
+ nudity = "artistic sensuality with focus on natural beauty"
291
+ else:
292
+ reveal = f"subtle hint of lace underwear during {role['pose']}"
293
+ underwear_desc = f"with delicate lace underwear under {role['uniform']}"
294
+ nudity = "elegant and professional with subtle sensuality"
295
+
296
+ prompt = (
297
+ f"Hyper-realistic 4K photograph, 9:16 vertical composition, full-body portrait from dynamic low angle, "
298
+ f"of a stunning {ethnicity.lower()} {role['role']} with {body} figure {skin}, "
299
+ f"{underwear_desc}, {hosiery}, {heels}, styled with {hairstyle}, and {makeup}. "
300
+ f"In {role['environment']}, captured during {role['pose']} causing {reveal}. "
301
+ f"{lighting}, {photo_style}, Camera: {camera} with {lens} lens, professional lighting setup, "
302
+ f"ultra-high resolution 16K, extreme detail showing skin texture with visible pores, "
303
+ f"realistic fabric wrinkles, subsurface scattering effect, cinematic depth of field. "
304
+ f"Professional atmosphere, elegant composition, {nudity}. "
305
+ f"Include {role['accessories']} in scene. --no explicit_nudity --style raw --stylize 150"
306
+ )
307
+
308
+ self.history.append({
309
+ "type": "role",
310
+ "ethnicity": ethnicity,
311
+ "role": role_name,
312
+ "nsfw": nsfw_mode,
313
+ "prompt": prompt,
314
+ "timestamp": datetime.datetime.now().isoformat()
315
+ })
316
+ return prompt
317
+
318
+ def generate_moment_prompt(self, ethnicity: str, moment_name: str, nsfw_mode: bool = False) -> str:
319
+ moment = self._get_moment_by_name(moment_name)
320
+ body, skin, lace, hosiery, heels, hairstyle, makeup, lighting, photo_style, camera, lens = self._random_style()
321
+
322
+ if nsfw_mode:
323
+ reveal = f"natural reveal of {lace} while {moment['action']}"
324
+ underwear_desc = f"wearing {lace} under {moment['outfit']}"
325
+ sensuality = "artistic intimate moment with sensual atmosphere"
326
+ else:
327
+ reveal = f"subtle suggestion of lace underwear while {moment['action']}"
328
+ underwear_desc = f"with delicate lace underwear under {moment['outfit']}"
329
+ sensuality = "natural private moment with elegant sensuality"
330
+
331
+ prompt = (
332
+ f"Hyper-realistic candid photograph, 9:16 vertical format, intimate low angle perspective, "
333
+ f"of a beautiful {ethnicity.lower()} woman with {body} physique {skin}, styled with {hairstyle}, and {makeup}. "
334
+ f"{underwear_desc}, {hosiery}, {heels}, in {moment['setting']}, "
335
+ f"captured during {moment['pose']}, {moment['action']}. "
336
+ f"{lighting}, {photo_style}, Camera: {camera} with {lens}, ultra-high detail 16K resolution, "
337
+ f"realistic skin texture with pores and fine hairs, fabric micro-details, "
338
+ f"natural lighting with soft shadows, cinematic composition. "
339
+ f"{sensuality}. Include {moment['accessories']} in scene. "
340
+ f"--no explicit_content --style photographic --stylize 180"
341
+ )
342
+
343
+ self.history.append({
344
+ "type": "moment",
345
+ "ethnicity": ethnicity,
346
+ "scene": moment_name,
347
+ "nsfw": nsfw_mode,
348
+ "prompt": prompt,
349
+ "timestamp": datetime.datetime.now().isoformat()
350
+ })
351
+ return prompt
352
+
353
+ def generate_batch_prompts(self, count: int, prompt_type: str, nsfw_mode: bool = False) -> List[str]:
354
+ prompts = []
355
+ for _ in range(count):
356
+ ethnicity = random.choice(self.config.ETHNICITIES)
357
+ if prompt_type == "roles":
358
+ role = random.choice([r["role"] for r in self.config.PROFESSIONAL_ROLES])
359
+ prompts.append(self.generate_role_prompt(ethnicity, role, nsfw_mode))
360
+ else:
361
+ moment = random.choice([m["scene"] for m in self.config.EVERYDAY_MOMENTS])
362
+ prompts.append(self.generate_moment_prompt(ethnicity, moment, nsfw_mode))
363
+ return prompts
364
+
365
+ def get_history(self) -> List[Dict]:
366
+ return self.history
367
+
368
+ def clear_history(self) -> str:
369
+ self.history = []
370
+ return "History cleared"
371
+
372
+ # Crear instancia del generador
373
+ generator = HyperRealisticPromptGenerator()
374
+
375
+ # JavaScript para copiar al portapapeles
376
+ copy_js = """
377
+ function copyToClipboard(text) {
378
+ navigator.clipboard.writeText(text).then(function() {
379
+ console.log('Text copied to clipboard');
380
+ }).catch(function(err) {
381
+ console.error('Could not copy text: ', err);
382
+ });
383
+ }
384
+ """
385
+
386
+ def generate_batch_with_blocks(count, prompt_type, nsfw):
387
+ prompts = generator.generate_batch_prompts(count, prompt_type, nsfw)
388
+ blocks_html = ""
389
+ for i, prompt in enumerate(prompts, 1):
390
+ blocks_html += f"""
391
+ <div class="prompt-block">
392
+ <h4>📋 Prompt #{i}:</h4>
393
+ <textarea style="width: 100%; height: 150px; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-family: monospace; margin-bottom: 10px;" readonly>{prompt}</textarea>
394
+ <button class="copy-btn" onclick="copyToClipboard(`{prompt}`)">📋 Copy Prompt #{i}</button>
395
+ </div>
396
+ """
397
+ return prompts, blocks_html
398
+
399
+ def export_history():
400
+ history = generator.get_history()
401
+ if not history:
402
+ return "No history to export"
403
+
404
+ filename = f"prompt_history_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
405
+ with open(filename, 'w', encoding='utf-8') as f:
406
+ json.dump(history, f, indent=2, ensure_ascii=False)
407
+ return f"History exported to {filename}"# Interfaz Gradio
408
+ with gr.Blocks(title="HyperRealistic Humanized Perfection Generator", theme=gr.themes.Soft(), css="""
409
+ .prompt-block {
410
+ border: 1px solid #e0e0e0;
411
+ border-radius: 10px;
412
+ padding: 15px;
413
+ margin: 10px 0;
414
+ background: white;
415
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
416
+ }
417
+ .copy-btn {
418
+ background: #4CAF50;
419
+ color: white;
420
+ border: none;
421
+ padding: 8px 16px;
422
+ border-radius: 5px;
423
+ cursor: pointer;
424
+ margin-top: 10px;
425
+ }
426
+ .copy-btn:hover {
427
+ background: #45a049;
428
+ }
429
+ .tab-content {
430
+ padding: 20px;
431
+ }
432
+ .generated-prompt {
433
+ font-family: monospace;
434
+ background: #f8f9fa;
435
+ padding: 15px;
436
+ border-radius: 8px;
437
+ border: 1px solid #e9ecef;
438
+ margin: 10px 0;
439
+ white-space: pre-wrap;
440
+ word-wrap: break-word;
441
+ }
442
+ """) as demo:
443
+
444
+ gr.Markdown("# 🌟 HyperRealistic Humanized Perfection Generator")
445
+ gr.Markdown("Generate ultra-realistic humanized prompts with perfect lace details in 9:16 vertical format")
446
+
447
+ # Inyectar JavaScript
448
+ gr.HTML(f"<script>{copy_js}</script>")
449
+
450
+ with gr.Tab("👔 Professional Roles"):
451
+ with gr.Row():
452
+ with gr.Column(scale=1):
453
+ role_ethnicity = gr.Dropdown(
454
+ choices=generator.config.ETHNICITIES,
455
+ label="🎭 Ethnicity",
456
+ value="Mediterranean",
457
+ interactive=True
458
+ )
459
+ role_selection = gr.Dropdown(
460
+ choices=[role["role"] for role in generator.config.PROFESSIONAL_ROLES],
461
+ label="💼 Professional Role",
462
+ value=generator.config.PROFESSIONAL_ROLES[0]["role"],
463
+ interactive=True
464
+ )
465
+ role_nsfw = gr.Checkbox(
466
+ label="🎨 Artistic NSFW Mode",
467
+ value=False,
468
+ info="Enable for more artistic sensuality"
469
+ )
470
+ generate_role_btn = gr.Button(
471
+ "✨ Generate Role Prompt",
472
+ variant="primary",
473
+ size="lg"
474
+ )
475
+
476
+ with gr.Column(scale=2):
477
+ role_output = gr.Textbox(
478
+ label="📝 Generated Prompt",
479
+ lines=6,
480
+ max_lines=10,
481
+ show_copy_button=True
482
+ )
483
+ role_prompt_block = gr.HTML(label="Prompt Block")
484
+
485
+ generate_role_btn.click(
486
+ fn=generator.generate_role_prompt,
487
+ inputs=[role_ethnicity, role_selection, role_nsfw],
488
+ outputs=[role_output]
489
+ ).then(
490
+ fn=lambda prompt: f"""
491
+ <div class="prompt-block">
492
+ <h4>📋 Prompt Ready to Copy:</h4>
493
+ <div class="generated-prompt">{prompt}</div>
494
+ <button class="copy-btn" onclick="copyToClipboard(`{prompt}`)">📋 Copy Prompt</button>
495
+ </div>
496
+ """,
497
+ inputs=[role_output],
498
+ outputs=[role_prompt_block]
499
+ )
500
+
501
+ with gr.Tab("🏠 Everyday Moments"):
502
+ with gr.Row():
503
+ with gr.Column(scale=1):
504
+ moment_ethnicity = gr.Dropdown(
505
+ choices=generator.config.ETHNICITIES,
506
+ label="🎭 Ethnicity",
507
+ value="Latin American",
508
+ interactive=True
509
+ )
510
+ moment_selection = gr.Dropdown(
511
+ choices=[moment["scene"] for moment in generator.config.EVERYDAY_MOMENTS],
512
+ label="🌅 Daily Moment",
513
+ value=generator.config.EVERYDAY_MOMENTS[0]["scene"],
514
+ interactive=True
515
+ )
516
+ moment_nsfw = gr.Checkbox(
517
+ label="🎨 Artistic NSFW Mode",
518
+ value=False,
519
+ info="Enable for more artistic sensuality"
520
+ )
521
+ generate_moment_btn = gr.Button(
522
+ "✨ Generate Moment Prompt",
523
+ variant="primary",
524
+ size="lg"
525
+ )
526
+
527
+ with gr.Column(scale=2):
528
+ moment_output = gr.Textbox(
529
+ label="📝 Generated Prompt",
530
+ lines=6,
531
+ max_lines=10,
532
+ show_copy_button=True
533
+ )
534
+ moment_prompt_block = gr.HTML(label="Prompt Block")
535
+
536
+ generate_moment_btn.click(
537
+ fn=generator.generate_moment_prompt,
538
+ inputs=[moment_ethnicity, moment_selection, moment_nsfw],
539
+ outputs=[moment_output]
540
+ ).then(
541
+ fn=lambda prompt: f"""
542
+ <div class="prompt-block">
543
+ <h4>📋 Prompt Ready to Copy:</h4>
544
+ <div class="generated-prompt">{prompt}</div>
545
+ <button class="copy-btn" onclick="copyToClipboard(`{prompt}`)">📋 Copy Prompt</button>
546
+ </div>
547
+ """,
548
+ inputs=[moment_output],
549
+ outputs=[moment_prompt_block]
550
+ )
551
+
552
+ with gr.Tab("🔄 Batch Generator"):
553
+ with gr.Row():
554
+ with gr.Column():
555
+ batch_count = gr.Slider(
556
+ minimum=1,
557
+ maximum=10,
558
+ value=3,
559
+ step=1,
560
+ label="Number of Prompts"
561
+ )
562
+ batch_type = gr.Radio(
563
+ choices=["roles", "moments"],
564
+ label="Prompt Type",
565
+ value="roles",
566
+ interactive=True
567
+ )
568
+ batch_nsfw = gr.Checkbox(
569
+ label="🎨 Artistic NSFW Mode",
570
+ value=False
571
+ )
572
+ generate_batch_btn = gr.Button(
573
+ "🔄 Generate Batch",
574
+ variant="primary"
575
+ )
576
+
577
+ with gr.Column():
578
+ batch_output = gr.JSON(
579
+ label="📦 Batch Prompts"
580
+ )
581
+ batch_prompt_blocks = gr.HTML(label="Batch Prompt Blocks")
582
+
583
+ generate_batch_btn.click(
584
+ fn=generate_batch_with_blocks,
585
+ inputs=[batch_count, batch_type, batch_nsfw],
586
+ outputs=[batch_output, batch_prompt_blocks]
587
+ )
588
+
589
+ with gr.Tab("📊 History & Export"):
590
+ with gr.Row():
591
+ with gr.Column():
592
+ history_display = gr.JSON(
593
+ label="📜 Prompt History",
594
+ value=generator.get_history
595
+ )
596
+ clear_history_btn = gr.Button(
597
+ "🗑️ Clear History",
598
+ variant="secondary"
599
+ )
600
+
601
+ with gr.Column():
602
+ export_btn = gr.Button(
603
+ "💾 Export History as JSON",
604
+ variant="primary"
605
+ )
606
+ export_status = gr.Textbox(
607
+ label="Export Status",
608
+ interactive=False
609
+ )
610
+
611
+ clear_history_btn.click(
612
+ fn=generator.clear_history,
613
+ outputs=[]
614
+ ).then(
615
+ fn=lambda: [],
616
+ outputs=[history_display]
617
+ ).then(
618
+ fn=lambda: "History cleared",
619
+ outputs=[export_status]
620
+ )
621
+
622
+ export_btn.click(
623
+ fn=export_history,
624
+ outputs=[export_status]
625
+ ).then(
626
+ fn=generator.get_history,
627
+ outputs=[history_display]
628
+ )
629
+
630
+ with gr.Tab("ℹ️ Instructions"):
631
+ gr.Markdown("""
632
+ ## 🎯 How to Use This Generator
633
+
634
+ ### 🖼️ Hyper-Realistic Features:
635
+ - **9:16 Vertical Format** - Perfect for mobile viewing
636
+ - **Low-Angle Shots** - Strategic angles for intimate composition
637
+ - **Ultra HD 16K** - Extreme detail and realism
638
+ - **Humanized Perfection** - Natural skin textures and imperfections
639
+
640
+ ### 🎨 Prompt Types:
641
+ - **👔 Professional Roles**: 10 different professional scenarios
642
+ - **🏠 Everyday Moments**: 10 natural, intimate situations
643
+ - **🔄 Batch Generation**: Generate multiple prompts at once
644
+
645
+ ### ⚙️ Settings:
646
+ - **Ethnicity**: Choose from 11 diverse ethnic backgrounds
647
+ - **NSFW Mode**: Toggle artistic sensuality levels
648
+ - **Auto-Copy**: One-click copying from formatted blocks
649
+
650
+ ### 📋 Copying Prompts:
651
+ 1. Click the **"Generate"** button for your desired prompt type
652
+ 2. Use the **"Copy Prompt"** button in the formatted block
653
+ 3. Paste directly into your AI image generator
654
+
655
+ ### 🎯 Perfect For:
656
+ - Midjourney, Stable Diffusion, DALL-E
657
+ - Professional photography simulations
658
+ - Artistic and creative projects
659
+ - Hyper-realistic character creation
660
+
661
+ ### 📸 Technical Specifications:
662
+ - **Format**: 9:16 Vertical
663
+ - **Resolution**: 16K Ultra HD
664
+ - **Angles**: Low-angle, intimate perspectives
665
+ - **Lighting**: Professional studio and natural
666
+ - **Details**: Skin pores, fabric textures, subsurface scattering
667
+ """)
668
+
669
+ # Launch the application
670
+ if __name__ == "__main__":
671
+ demo.launch(
672
+ share=True,
673
+ debug=True,
674
+ show_error=True
675
+ )