ivanoctaviogaitansantos commited on
Commit
1116138
·
verified ·
1 Parent(s): 2c1ed0e

Update app.py

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