ivanoctaviogaitansantos commited on
Commit
8b218c3
·
verified ·
1 Parent(s): f123957

Actualizar app.py

Browse files
Files changed (1) hide show
  1. app.py +290 -1
app.py CHANGED
@@ -235,4 +235,293 @@ class UltimateSensualPromptGenerator:
235
  "perfect depth of field with creamy bokeh", "professional retouching that maintains skin texture",
236
  "subtle vignette to draw focus to the subject", "cinematic color palette with rich tones",
237
  "perfect exposure with detailed shadows and highlights"
238
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  "perfect depth of field with creamy bokeh", "professional retouching that maintains skin texture",
236
  "subtle vignette to draw focus to the subject", "cinematic color palette with rich tones",
237
  "perfect exposure with detailed shadows and highlights"
238
+ ),
239
+ "atmosphere": (
240
+ "soft, professional lighting without harsh shadows", "dramatic lighting with chiaroscuro effect",
241
+ "natural sunlight with soft diffusion", "moody atmospheric lighting",
242
+ "studio lighting with perfect catchlights", "golden hour warmth with long shadows"
243
+ )
244
+ },
245
+ "luxury_brands": {
246
+ "lingerie": (
247
+ "La Perla", "Agent Provocateur", "Fleur du Mal", "Victoria's Secret Luxury",
248
+ "Chantelle Paris", "Aubade", "Simone Pérèle", "Honey Birdette"
249
+ ),
250
+ "shoes": (
251
+ "Christian Louboutin", "Manolo Blahnik", "Jimmy Choo", "Giuseppe Zanotti",
252
+ "Stuart Weitzman", "Roger Vivier", "René Caovilla", "Alexandre Birman"
253
+ ),
254
+ "fashion": (
255
+ "Gucci", "Chanel", "Dior", "Prada", "Versace", "Balmain", "Dolce & Gabbana",
256
+ "Givenchy", "Fendi", "Bottega Veneta", "Valentino", "Yves Saint Laurent"
257
+ )
258
+ },
259
+ "negative_prompt": (
260
+ "nsfw, nude, explicit content, deformed, bad anatomy, disfigured, malformed, mutated, "
261
+ "extra limbs, missing limbs, floating limbs, disconnected limbs, extra fingers, "
262
+ "missing fingers, extra arms, missing arms, extra legs, missing legs, poorly drawn hands, "
263
+ "poorly drawn face, mutated hands, fused fingers, too many fingers, long neck, "
264
+ "blurry, low quality, jpeg artifacts, compression artifacts, poorly lit, overexposed, "
265
+ "underexposed, dark, pitch black, low contrast, oversaturated, undersaturated, "
266
+ "cartoon, anime, 3d, render, painting, drawing, sketch, illustration, CGI, "
267
+ "computer generated, synthetic, video game, graphic novel, comic book, "
268
+ "child, minor, infant, teenager, underage, young, youth, "
269
+ "grotesque, ugly, disgusting, unappealing, unattractive, "
270
+ "poor lighting, harsh shadows, annoying edges, sharp edges, "
271
+ "vulgar, explicit display, offensive, inappropriate, "
272
+ "watermark, signature, text, writing, letters, logo, brand, "
273
+ "border, frame, margin, edge, outline, "
274
+ "distracting elements, busy background, cluttered, messy, "
275
+ "out of focus, motion blur, camera shake, lens flare, chromatic aberration"
276
+ )
277
+ }
278
+
279
+ @staticmethod
280
+ def _choose_random(options: Tuple[str, ...]) -> str:
281
+ return random.choice(options)
282
+
283
+ def _generate_lingerie_fragment(self) -> str:
284
+ lingerie = self.DATA["lingerie"]
285
+ set_type = random.choice(["bra_thong", "bodysuit", "teddy", "garter_set"])
286
+
287
+ if set_type == "bra_thong":
288
+ return (
289
+ f"{self._choose_random(lingerie['bra_styles'])} and "
290
+ f"{self._choose_random(lingerie['thong_colors'])} {self._choose_random(lingerie['panties_types'])} with "
291
+ f"{self._choose_random(lingerie['thigh_high_stockings'])} and "
292
+ f"{self._choose_random(lingerie['garter_belts'])}"
293
+ )
294
+ elif set_type == "bodysuit":
295
+ return (
296
+ f"{self._choose_random(lingerie['bodysuits_teddies'])} with "
297
+ f"{self._choose_random(lingerie['thigh_high_stockings'])}"
298
+ )
299
+ else:
300
+ return (
301
+ f"{self._choose_random(lingerie['bodysuits_teddies'])} with "
302
+ f"{self._choose_random(lingerie['thigh_high_stockings'])} and "
303
+ f"{self._choose_random(lingerie['garter_belts'])}"
304
+ )
305
+
306
+ def _generate_outfit_fragment(self) -> str:
307
+ outfit = self.DATA["outfit"]
308
+ outfit_type = random.choice(["secretary", "evening", "casual"])
309
+
310
+ if outfit_type == "secretary":
311
+ return (
312
+ f"{self._choose_random(outfit['secretary_dress'])} and "
313
+ f"{self._choose_random(outfit['high_heels'])}"
314
+ )
315
+ elif outfit_type == "evening":
316
+ return (
317
+ f"{self._choose_random(outfit['evening_dresses'])} and "
318
+ f"{self._choose_random(outfit['high_heels'])}"
319
+ )
320
+ else:
321
+ return (
322
+ f"{self._choose_random(outfit['casual_outfits'])} and "
323
+ f"{random.choice([self._choose_random(outfit['high_heels']), self._choose_random(outfit['boots'])])}"
324
+ )
325
+
326
+ def _generate_model_attributes_fragment(self) -> str:
327
+ attr = self.DATA["model_attributes"]
328
+ return (
329
+ f"{self._choose_random(attr['body_types'])} with "
330
+ f"{self._choose_random(attr['hair_styles'])} in "
331
+ f"{self._choose_random(attr['hair_colors'])} and "
332
+ f"{self._choose_random(attr['makeup_styles'])}. "
333
+ f"Her {self._choose_random(attr['nails'])} complete the look"
334
+ )
335
+
336
+ def _generate_technical_composition(self) -> str:
337
+ tech = self.DATA["technical_composition"]
338
+ return (
339
+ f"{self._choose_random(tech['quality_tags'])}. "
340
+ f"Captured with {self._choose_random(tech['cameras'])} and "
341
+ f"{self._choose_random(tech['lenses'])}, using "
342
+ f"{self._choose_random(tech['lighting'])}. "
343
+ f"{self._choose_random(tech['angles'])} with "
344
+ f"{self._choose_random(tech['framing'])}. "
345
+ f"{self._choose_random(tech['editing'])}. "
346
+ f"The scene features {self._choose_random(tech['atmosphere'])}. "
347
+ f"(BATUTO-ART watermark:0.4)"
348
+ )
349
+
350
+ def _select_scenario(self, category: Optional[str] = None) -> str:
351
+ if category and category in self.DATA["scenarios"]:
352
+ return self._choose_random(self.DATA["scenarios"][category])
353
+ else:
354
+ all_scenarios = []
355
+ for cat in self.DATA["scenarios"].values():
356
+ if isinstance(cat, tuple):
357
+ all_scenarios.extend(cat)
358
+ return self._choose_random(tuple(all_scenarios))
359
+
360
+ def _add_luxury_brands(self) -> str:
361
+ brands = self.DATA["luxury_brands"]
362
+ brand_type = random.choice(["lingerie", "shoes", "fashion"])
363
+ brand = self._choose_random(brands[brand_type])
364
+
365
+ if brand_type == "lingerie":
366
+ return f"wearing {brand} delicate lingerie"
367
+ elif brand_type == "shoes":
368
+ return f"wearing {brand} designer heels"
369
+ else:
370
+ return f"wearing a {brand} outfit"
371
+
372
+ def generate_prompt(self, celebrity_name: str, scenario_category: Optional[str] = None) -> str:
373
+ if not celebrity_name.strip():
374
+ return "⚠️ Please enter a celebrity name to generate prompts."
375
+
376
+ expression = self._choose_random(self.DATA["scenarios"]["expressions"])
377
+ pose = self._choose_random(self.DATA["scenarios"]["poses"])
378
+ location = self._choose_random(self.DATA["scenarios"]["locations"])
379
+ lingerie_fragment = self._generate_lingerie_fragment()
380
+ outfit_fragment = self._generate_outfit_fragment()
381
+ model_attributes_fragment = self._generate_model_attributes_fragment()
382
+ luxury_brand = self._add_luxury_brands()
383
+ scenario = self._select_scenario(scenario_category)
384
+ technical_desc = self._generate_technical_composition()
385
+ negative_prompt = self.DATA["negative_prompt"]
386
+
387
+ focus = random.choice(["lingerie", "outfit"])
388
+
389
+ if focus == "lingerie":
390
+ clothing_description = f"{lingerie_fragment}"
391
+ else:
392
+ clothing_description = f"{outfit_fragment} that subtly reveals {lingerie_fragment} beneath"
393
+
394
+ prompt = (
395
+ f"The renowned celebrity {celebrity_name} is captured in a professional photograph "
396
+ f"that conveys natural sensuality and elegance. {expression}, {pose} "
397
+ f"with {model_attributes_fragment}. She is {luxury_brand} and {clothing_description}. "
398
+ f"Scene: {scenario} {location}. "
399
+ f"{technical_desc}"
400
+ )
401
+
402
+ return f"{prompt} | Negative prompt: {negative_prompt}"
403
+
404
+ def generate_multiple_prompts(self, celebrity_name: str, scenario_category: Optional[str] = None, count: int = 5) -> List[str]:
405
+ if not celebrity_name.strip():
406
+ return ["⚠️ Please enter a celebrity name to generate prompts."] * count
407
+
408
+ return [self.generate_prompt(celebrity_name, scenario_category) for _ in range(count)]
409
+
410
+
411
+ def build_gradio_app():
412
+ generator = UltimateSensualPromptGenerator()
413
+
414
+ title_html = """
415
+ <div style="text-align: center;">
416
+ <h1 style="
417
+ font-family: 'Georgia', serif;
418
+ font-size: 3.5em;
419
+ font-weight: bold;
420
+ background: linear-gradient(45deg, #FF6B6B, #FF8E53, #FFCA3A, #8AC926, #1982C4, #6A4C93);
421
+ -webkit-background-clip: text;
422
+ -webkit-text-fill-color: transparent;
423
+ text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
424
+ margin-bottom: 10px;">
425
+ 🐾 MAXIM BatutoArt 🐾
426
+ </h1>
427
+ <p style="text-align: center; font-family: 'Georgia', serif; font-size: 1.2em; color: #6A4C93; margin-top: -10px;">
428
+ Ultimate Sensual Fashion Prompt Generator
429
+ </p>
430
+ </div>
431
+ """
432
+
433
+ css = """
434
+ .gradio-container {
435
+ background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
436
+ }
437
+ .container {
438
+ max-width: 1200px;
439
+ margin: 0 auto;
440
+ }
441
+ .prompt-box {
442
+ background: white;
443
+ border-radius: 10px;
444
+ padding: 15px;
445
+ margin-bottom: 15px;
446
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
447
+ border-left: 4px solid #6A4C93;
448
+ }
449
+ .copy-btn {
450
+ background: #6A4C93 !important;
451
+ color: white !important;
452
+ }
453
+ .generate-btn {
454
+ background: linear-gradient(45deg, #FF6B6B, #FF8E53) !important;
455
+ color: white !important;
456
+ font-weight: bold !important;
457
+ }
458
+ """
459
+
460
+ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
461
+ gr.HTML(title_html)
462
+
463
+ with gr.Row():
464
+ with gr.Column(scale=3):
465
+ name_input = gr.Textbox(
466
+ label="Enter Celebrity Name:",
467
+ placeholder="e.g., Ana de Armas, Margot Robbie, Alexandra Daddario, Emma Stone",
468
+ interactive=True
469
+ )
470
+ with gr.Column(scale=2):
471
+ scenario_input = gr.Dropdown(
472
+ label="Scenario Category (optional):",
473
+ choices=["All", "office_secretary", "schoolgirl_uniform", "mini_skirt_lingerie",
474
+ "boudoir_scenes", "beach_swimwear"],
475
+ value="All",
476
+ interactive=True
477
+ )
478
+
479
+ with gr.Row():
480
+ generate_button = gr.Button("✨ Generate 5 Ultimate Prompts", variant="primary", elem_classes="generate-btn")
481
+
482
+ gr.Markdown("### 📝 Generated Prompts")
483
+
484
+ prompt_boxes = []
485
+ for i in range(5):
486
+ with gr.Row():
487
+ with gr.Column(scale=8):
488
+ prompt_txt = gr.Textbox(
489
+ label=f"Prompt {i+1}",
490
+ interactive=False,
491
+ lines=4,
492
+ max_lines=6,
493
+ show_copy_button=True,
494
+ elem_classes="prompt-box"
495
+ )
496
+ with gr.Column(scale=1, min_width=100):
497
+ copy_btn = gr.Button("📋 Copy", elem_classes="copy-btn")
498
+ copy_btn.click(
499
+ fn=None,
500
+ inputs=[prompt_txt],
501
+ outputs=None,
502
+ js="(text) => {navigator.clipboard.writeText(text); alert('Prompt copied to clipboard!')}",
503
+ )
504
+ prompt_boxes.append(prompt_txt)
505
+
506
+ generate_button.click(
507
+ fn=generator.generate_multiple_prompts,
508
+ inputs=[name_input, scenario_input],
509
+ outputs=prompt_boxes
510
+ )
511
+
512
+ gr.Markdown("---")
513
+ gr.Markdown(
514
+ """
515
+ <div style="text-align: center; color: #666; font-size: 0.9em;">
516
+ <p>Create stunning AI-generated fashion imagery with detailed prompts</p>
517
+ <p>Each prompt includes technical specifications for optimal results</p>
518
+ </div>
519
+ """
520
+ )
521
+
522
+ return app
523
+
524
+
525
+ if __name__ == "__main__":
526
+ app = build_gradio_app()
527
+ app.launch(share=True)