ivanoctaviogaitansantos's picture
Update app.py
edced2e verified
import random
import gradio as gr
# --- Database of Garments and Elements ---
TOPS = [
"classic white blouse slightly unbuttoned showing collarbones",
"high-neck lace blouse with sheer sections",
"flowy silk blouse with a delicate lace top underneath",
"off-shoulder linen blouse with a subtle, eye-catching necklace",
"black velvet bodysuit with a plunging neckline",
"ruby satin shirt knotted at the waist, showing the abdomen",
"fitted cotton top with thin straps",
"basic fitted cotton crop top",
"thin cardigan buttoned just enough to hint at the cleavage",
"floral lace top with a plunging V-neck",
"fitted knit top with an asymmetrical off-shoulder neckline",
"champagne satin t-shirt with a deep neckline",
"fitted strapless push-up top",
"masculine cut blazer worn with nothing underneath",
"lace bralette with thin straps",
"fitted floral print crop top",
"backless cropped halter top",
"short, fitted nightgown for sleeping",
]
BOTTOMS_MINISKIRTS = [
"asymmetrical miniskirt with a prominent ruffle revealing the thigh",
"soft suede miniskirt that rides up when sitting",
"thin ribbed miniskirt with a wide elastic waistband",
"sequin miniskirt that sparkles when moving",
"fitted knit miniskirt accentuating hips",
"shiny lamé miniskirt with sharp pleats",
"brocade miniskirt with golden threads",
"very tight stretch tech fabric miniskirt",
"black velvet miniskirt with subtle sparkles",
"layered ruffle miniskirt that floats when walking",
"asymmetrical leather miniskirt with suggestive buttons",
"fitted animal print miniskirt that enhances curves",
"miniskirt with an adjustable side tie ready to be undone",
"honeycomb miniskirt with elastic panels",
"wrap miniskirt that opens when moving",
"fitted elastic cotton miniskirt that naturally rides up",
"vegan leather miniskirt with provocative zippers",
"lace miniskirt with a contrasting lining peeking out",
"vintage style miniskirt with large buttons",
"snake-effect miniskirt with a dangerous slit",
]
BOTTOMS_SHEER_DRESSES = [
"short stretch mesh dress, translucent synthetic fabric, deep V-neck, sleeveless, fitted, visible underwear",
"short tulle dress, very translucent, plunging neckline, sleeveless, airy, partial lining or lace detail option",
"short stretch lace dress, fine mesh base, deep neckline, sleeveless, floral or geometric, scalloped hem",
"short stretch chiffon dress, translucent and soft, V-neck or sweetheart neckline, sleeveless, light drape",
"short satin organza dress, semi-sheer with a slight sheen, deep neckline, sleeveless, structured and elegant",
"short laise dress, partially translucent cotton with perforations, deep neckline, sleeveless, delicate embroidery",
"short stretch satin dress, shiny and slightly translucent, deep V-neck, sleeveless, glamorous and fitted",
"sexy short long-sleeved dress, plain, sheer",
"short sheer fishing net dress",
"mesh dress with strategic sheer panels",
]
BOTTOMS_TIGHT_DRESSES = [
"short bandage dress that leaves little to the imagination",
"short fitted velvet dress with a thigh-high slit",
"short tight dress with strategic cutouts",
"short fitted knit dress with a dangerous neckline",
"short cocktail dress with a plunging asymmetrical neckline",
"short shiny satin dress with a plunging back",
"short fitted faux leather dress with provocative zippers",
"short long-sleeved dress in a very suggestive shiny fabric",
"tight animal print dress, overflowing with curves",
"tight lingerie dress with hinting lace spots",
"elegant fitted and sexy sleeveless dress",
"short draped dress",
"short wrap dress",
"short denim sack dress with wear and tear",
"tight striped knit dress",
"short criss-cross armhole dress",
"short fitted sleeveless tray dress",
"sexy sleeveless criss-cross high-neck dress with a slit",
"sexy short long-sleeved fitted dress with holes, plain color, for party and club",
"fitted sleeveless dress with a round neck and lace-up details",
"tight criss-cross back jumpsuit with a v-neck",
"short lingerie dress with side slits up to the waist",
"tight spaghetti strap dress",
]
BOTTOMS_SUMMER_DRESSES = [
"short shirtdress barely covering the essentials",
"short polka dot dress with a mischievous V-neck",
"short fitted stretch cotton dress where it counts",
"short crochet dress with strategically placed lace",
"short white Ibiza style dress that becomes translucent in the sun",
"short linen dress with a high side slit",
"short openwork knit dress with a hinting slip underneath",
"short fluid knit dress that dances with movement",
"short dress with a gathered skirt that lifts up easily",
"short A-line dress that flares out provocatively",
"summer dress",
"short floral print dress",
"wrap dress with a belt",
]
BOTTOMS_ELEGANT_DRESSES = [
"short dress with shiny embroidery that directs the gaze downwards",
"short empire-cut chiffon dress with a large slit",
"short lace dress with hinting cutouts",
"short sequin dress with a large V-neck and open back",
"short mikado dress with open sides",
"short satin dress with a vertiginous neckline",
"short taffeta dress with an overskirt that temptingly lifts",
"short brocade dress with a faux illusion neckline",
"short velvet dress with a sweetheart neckline enhancing cleavage",
"short strapless dress with a slit at the hip",
"short black dress with a back slit",
"burnt dress",
"sexy sleeveless criss-cross high-neck dress with a slit",
"fitted sleeveless dress with a round neck and lace-up details",
"tight criss-cross back jumpsuit with a v-neck",
"long dress with a thigh slit, boat neck, long sleeves",
"short lingerie dress with side slits up to the waist",
]
BOTTOMS_HISTORICAL_DRESSES = [
"Victorian gothic dress with a hood, corset, and open bell sleeves",
"Viking warrior outfit: miniskirt with straps and a square-neck blouse",
"pirate look: flowing blouse, leather corset, and pleated miniskirt",
"long Renaissance velvet skirt with a rigid corset and semi-visible slip",
"black velvet Renaissance dress, square neckline, trumpet sleeves, and lace",
"long medieval maiden dress with a corset and translucent lantern sleeves",
"dress with a corset, butterfly sleeves, and an asymmetrical hem, with bow details",
"elf fairy costume: tulle, corset, semi-sheer wings, and trumpet sleeves",
"kawaii maid dress: ruffled miniskirt and apron with a side bow",
"long Victorian dress with a corset, choker, and bell sleeves",
"medieval Irish dress: thick overskirt, long sleeves, corset, and skirt",
"Wednesday-style Peter Pan collar dress with a short pleated skirt and long sleeves",
"Oktoberfest dress: tight corset, short skirt, and classic apron",
"gothic medieval sheer dress with a corset, off-the-shoulder design, and lace",
"Rococo regency dress: voluminous skirt, corset with a choker, and lace",
"medieval Renaissance dance dress, long sleeves and a flowing skirt",
]
SHOES = [
"pointed stilettos that lengthen the legs",
"elegant high-heeled ankle boots with delicate straps",
"high mules barely clinging to the feet",
"elegant peep-toes showing painted nails",
"thin-heeled sandals with an ankle strap",
"criss-cross strap sandals going up the calf",
"patent leather stilettos that reflect light",
"classic shoes with a red sole",
"ankle-strap heels with delicate buckles",
"dance boots",
"patent leather ankle boots with a decorative wide heel",
"Mary Jane style shoes with breaking straps and a bow",
"square-toe velvet ballet flats",
"tall Victorian lace-up boots",
"classic gladiator sandals to the ankle",
]
LINGERIE_SETS = [
"vibrant red lace bikini that subtly contrasts with the outfit",
"black lace bikini with golden details and thigh-high stockings",
"electric blue lace bikini with a scalloped edge and sheer stockings",
"emerald green lace bikini with small bows and fishnet stockings",
"purple lace bikini with a contrasting trim and silk stockings",
"shiny gold lace bikini with fine lace stockings",
"fuchsia lace bikini with hinting cutouts and self-adhesive stockings",
"turquoise lace bikini with a side tie and satin stockings",
"scarlet lace bikini with a heart detail and tulle stockings",
"amethyst lace bikini with thin side straps and lycra stockings",
"French lace bikini with a high-cut and satin bow, pleated lace stockings",
"Italian lace bikini with a sheer back and silk stockings",
"chantilly lace bikini with Swarovski crystals and mesh stockings",
]
POSES_SUGGESTIVE = [
"standing with legs slightly apart, hips forward and one hand subtly lifting the skirt to hint at the lace panties, low shot and 9:16 vertical framing, seductive and direct gaze at the camera",
"sitting on the edge of a desk, legs crossed in a way that the skirt lifts slightly showing the elastic of the lace panties, hands resting behind, arching the back, intense and frontal gaze",
"leaning over a railing, dress or skirt slightly riding up to hint at the lace panties, looking over the shoulder with a seductive expression, low-angle shot to highlight the legs",
"back to the window, twisting the waist to show the profile and one hand adjusting the skirt to subtly reveal the lace of the panties, natural light creating shadows that emphasize the curves",
"reclining on a sofa, one leg bent to slightly open the skirt and fingers brushing against the lace panties, sensual low frontal shot, direct and provocative gaze",
"going up stairs seen from behind, skirt moving in a way that hints at the lace panties, body in motion and elegant posture, nadir angle to highlight the legs",
"spinning in a chair, skirt momentarily opening to hint at the lace panties, hands on the seat and fixed gaze at the camera, dynamic and sensual pose",
"bending down to pick up an object, skirt adjusting and subtly revealing the lace panties, shot from below to emphasize the legs and the pose",
"leaning against the wall with one leg slightly raised, skirt falling in a way that hints at the lace panties, playing with the hair and a seductive gaze",
"lying on the grass with legs semi-open and skirt pulled up just enough to hint at the lace panties, arms extended and a relaxed but sensual expression",
"on a bar stool, one leg dangling and the other crossed in a way that hints at the lace panties, leaning forward with a drink in hand and an intense gaze",
"adjusting the skirt while sitting, one leg extended and the skirt rising just enough to hint at the lace panties, biting the lower lip and a direct gaze",
"getting out of a car, dress getting caught in a way that hints at the lace panties, expression of amused surprise and a flirtatious gaze",
"stretching arms upwards, top rising and skirt higher to hint at the lace panties, innocent but suggestive expression",
"playing with the hem of the skirt while sitting, subtly covering and uncovering the lace panties, a mischievous smile and direct eye contact",
"direct gaze at the camera with a confident smile, hand slightly lifting the hem of the skirt to hint at the lace panties, upright and elegant posture",
"sitting with legs crossed strategically, skirt displaced to hint at the lace panties, face with a soft smile and a penetrating gaze",
"semi-leaning forward with hands resting on a surface, gaze fixed on the viewer and skirt riding up just enough to hint at the lace panties, elegant and sensual pose",
"in profile with head turned and hand delicately holding the skirt, a seductive but elegant expression, skirt fitted to hint at the lace panties",
]
ENVIRONMENTS = [
"luxurious penthouse with sunset windows, golden light filtering in and creating soft shadows",
"premium boutique fitting room with multiple mirrors and warm light that highlights the curves",
"rooftop garden with a skyscraper background and diffuse natural light",
"art gallery with dramatic spotlights illuminating the silhouette",
"five-star hotel suite with champagne and dim light that emphasizes sensuality",
"private jet interior with leather armchairs and elegant ambient light",
"yacht deck with an ocean view and golden sunset light",
"exclusive club with a designer lounge and dim light that creates intimacy",
"designer showroom with runway lights that highlight the details",
"library of a historic mansion with wood panels and warm light",
"modern museum with minimalist decor and filtered natural light",
"private beach cabin at sunset with golden light and a gentle breeze",
"luxury spa with steam and dim light that blurs the contours",
"fashion photographer's studio loft with professional light and neutral backgrounds",
"exotic greenhouse with tropical plants and diffuse natural light",
"piano lounge in a luxury hotel with ambient light and classic elegance",
"penthouse terrace with an infinity pool and golden twilight light",
"VIP casino with champagne and dim light that creates an intimate atmosphere",
"couture atelier with rolls of fabric in the background and soft natural light",
"rooftop private cinema under the stars with romantic ambient light",
]
# --- MISSING LISTS ADDED HERE ---
HAIRSTYLES = [
"long wavy hair", "sleek ponytail", "messy bun",
"voluminous curls", "short bob with bangs", "braided updo"
]
MAKEUP = [
"smoky eyes and nude lips", "bold red lipstick and a clean face",
"soft glam with a natural glow", "dramatic eyeliner and glossy lips",
"gothic style with dark lipstick and heavy eyeshadow"
]
# -----------------------------
NEGATIVE_PROMPT = (
"(low quality, worst quality:1.4), (incorrect, deformed, distorted anatomy:1.3), blurry, "
"(badly drawn face, malformed hands:1.3), disfigured, extra limbs, (ugly, duplicated, morbid:1.2), "
"(mutilated, poorly drawn:1.2), out of frame, extra fingers, mutated hands, (watermark, signature:1.4), text, error, "
"cropped, jpeg artifacts, (normal quality:1.3), (low resolution:1.1), "
"skin spots, acne, scars, (missing arms, missing legs:1.3), (deformed fingers:1.2), "
"(bad proportions:1.3), (unnatural pose:1.2), (cloned face:1.2), (doll effect:1.3), "
"(oversaturated:1.1), (unprofessional lighting:1.3), (explicit content:1.5), (visible bra:1.2), "
"(fully exposed underwear:1.3), (exposed genitals:1.5), (lack of elegance:1.2)"
)
# --- Functions to Generate Prompts ---
def select_random_outfit():
"""Selects a random outfit that hints at the lace panties."""
bottom_type = random.choice([
"miniskirt", "sheer_dress", "tight_dress",
"summer_dress", "elegant_dress", "historical_dress"
])
if bottom_type == "miniskirt":
top = random.choice(TOPS)
bottom = random.choice(BOTTOMS_MINISKIRTS)
elif bottom_type == "sheer_dress":
top = None
bottom = random.choice(BOTTOMS_SHEER_DRESSES)
elif bottom_type == "tight_dress":
top = None
bottom = random.choice(BOTTOMS_TIGHT_DRESSES)
elif bottom_type == "summer_dress":
top = None
bottom = random.choice(BOTTOMS_SUMMER_DRESSES)
elif bottom_type == "elegant_dress":
top = None
bottom = random.choice(BOTTOMS_ELEGANT_DRESSES)
elif bottom_type == "historical_dress":
top = None
bottom = random.choice(BOTTOMS_HISTORICAL_DRESSES)
shoes = random.choice(SHOES)
lingerie_set = random.choice(LINGERIE_SETS)
hairstyle = random.choice(HAIRSTYLES)
makeup = random.choice(MAKEUP)
pose = random.choice(POSES_SUGGESTIVE)
environment = random.choice(ENVIRONMENTS)
return {
"top": top,
"bottom": bottom,
"shoes": shoes,
"lingerie_set": lingerie_set,
"hairstyle": hairstyle,
"makeup": makeup,
"pose": pose,
"environment": environment,
}
def generate_single_prompt(name):
"""Generates a detailed prompt for a celebrity, focused on hinting at the lace panties."""
outfit = select_random_outfit()
prompt = (
f"Professional ultra-high resolution **full color photography** of {name}, "
f"high detail, photo-realistic, medium-full body shot, subject filling the frame from the knees up. "
f"Elegant makeup: {outfit['makeup']}. "
f"Hair: {outfit['hairstyle']} with long dyed hair. "
f"Scenario: {outfit['environment']}. "
f"Pose: {outfit['pose']}. "
f"Wearing: {outfit['bottom']}, "
)
if outfit['top']:
prompt += f"with {outfit['top']}, "
prompt += (
f"{outfit['shoes']}, "
f"and {outfit['lingerie_set']} with thigh-high stockings that subtly contrast with the outfit. "
f"Natural volumetric lighting with sun rays creating soft shadows, "
f"highlighting curves and the delicate lace details of the underwear. "
f"Sharp, dramatic focus on the eyes and the suggestive lace underwear. "
f"Cinematic, sensual, and provocative style, with a seductive gaze and direct eye contact. "
f"Shot with Canon EOS R5, Canon RF 85mm f/1.2L, low-angle (nadir) perspective to emphasize legs and lace details. "
f"--style raw --ar 9:16 --v 6.0 --style raw. "
f"Negative prompt: {NEGATIVE_PROMPT}"
)
return prompt
def generate_prompts(name):
"""Generates multiple prompts for a celebrity."""
if not name.strip():
# Retorna 5 prompts con el mensaje de error para llenar todas las cajas de texto
return ["Please enter a celebrity name."] * 5
name = name.strip()
return [generate_single_prompt(name) for _ in range(5)]
# --- Gradio Interface ---
with gr.Blocks(theme=gr.themes.Soft(primary_hue="pink", secondary_hue="red")) as demo:
gr.Markdown(
"""
<style>
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Montserrat:wght@300;500&display=swap');
h1 {
font-family: 'Playfair Display', serif;
font-size: 2.8em;
background: linear-gradient(to right, #FF0076, #FF6B9C, #FF9DBE);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
text-align: center;
padding: 10px;
margin-bottom: 20px;
}
.gradio-container {
background: linear-gradient(135deg, #2C2C2C 0%, #1A1A1A 100%);
color: #FFFFFF;
font-family: 'Montserrat', sans-serif;
}
.gr-button {
background: linear-gradient(to right, #FF0076, #FF6B9C) !important;
color: white !important;
border: none !important;
font-weight: 500;
}
.gr-button:hover {
background: linear-gradient(to right, #FF6B9C, #FF0076) !important;
}
.gr-box {
border-color: #FF6B9C !important;
border-radius: 8px;
}
.dark .panel {
background-color: #2C2C2C;
border-radius: 10px;
padding: 15px;
margin-bottom: 15px;
}
</style>
# SENSUAL PHOTOGRAPHY PROMPT GENERATOR ✨
"""
)
with gr.Row():
with gr.Column(scale=1):
gr.Markdown(
"""
<div class="panel">
<h3>Instructions</h3>
<p>Enter a celebrity's name and click the button to generate sensual prompts with:</p>
<ul>
<li>Poses that elegantly hint at the lace panties</li>
<li>Thigh-high stockings that contrast with the outfit</li>
<li>Low angles (nadir) to highlight legs and details</li>
<li>Seductive gaze and direct eye contact</li>
<li>Natural lighting that emphasizes sensuality</li>
</ul>
</div>
"""
)
celebrity_name = gr.Textbox(
label="Celebrity Name",
placeholder="Ex: Megan Fox, Scarlett Johansson, Ariana Grande...",
lines=1
)
# El slider ya no se usa para la lógica de generación
# Se puede eliminar o dejar como una sugerencia visual
num_prompts = gr.Slider(
label="Number of Prompts (Always generates 5)",
minimum=1,
maximum=5,
value=5, # Valor por defecto ajustado a 5
step=1,
interactive=False # Se hace no interactivo para evitar confusión
)
generate_btn = gr.Button("Generate Sensual Prompts", variant="primary")
with gr.Column(scale=2):
# Se mantienen las 5 cajas de texto ya que la función siempre devuelve 5 resultados
prompt_outputs = [
gr.Textbox(
label=f"Prompt {i+1}",
lines=8,
interactive=False,
show_copy_button=True
) for i in range(5)
]
# La llamada a la función se ajusta para que no use el valor del slider
generate_btn.click(
fn=lambda name: generate_prompts(name),
inputs=[celebrity_name],
outputs=prompt_outputs
)
if __name__ == "__main__":
demo.launch()