import random import gradio as gr # --- Datos base --- ROLES = [ "Executive Secretary", "Luxury Hotel Manager", "Fashion Boutique Manager", "Corporate Lawyer", "Private Jet Attendant", "Art Gallery Curator", "University Professor", "Wine Sommelier", "Ballet Instructor", "Yacht Stewardess", "Casino Dealer", "News Anchor", "Elegant Maid", "Flight Attendant", "Sensual Nun", "Police Officer", "Military Officer", "Nurse", "Schoolgirl", "Fitness Instructor", "Yoga Practitioner", "Salsa Dancer", "Telenovela Actress", "Latin Chef", "Fiesta Organizer", "Latin Sommelier", "Flamenco Guitarist", "Latin Diplomat", "Mariachi Singer", "Latin Curator", "Samba Instructor", "1960s WAC Officer", "Vietnam Era Military Nurse", "1980s Air Force Pilot", "1990s Army General", "2000s Marine Corps Captain", "2010s Cyber Warfare Specialist", "2020s Special Forces Operator", "Artemis Program Commander", "1960s WAVES Ensign", "1970s Navy Aviator", "1980s Submarine Officer", "1990s Naval Intelligence Analyst" ] LENCERIA = [ "a subtle glimpse of a lace thong above her waistband as she bends over", "a hint of a lace thong visible as she sits down", "the outline of a g-string visible through her uniform as she stretches", "a peek of a black lace thong as her skirt naturally moves" ] MEDIAS = "thigh-high stockings with detailed lace texture" TACONES = "elegant high heels appropriate for the profession" ESTILO = "hyperrealistic professional photography, 16K, sharp focus, detailed skin texture, anatomically correct, subtle subsurface scattering" FORMATO = "full body vertical shot, 9:16 aspect ratio" ANGULO = "low-angle view from knees up" SUJETO = "delicate-featured Latina woman, sensual body with soft curves" CAMARAS = ["Canon EOS R5", "Sony α7R V", "Nikon Z9"] LENTES = ["85mm f/1.2 lens", "50mm f/1.4 portrait lens"] ILUMINACION = ["professional studio lighting", "golden hour sunlight", "soft natural window light"] # Función backend para generar el prompt def generar_prompt(role, lenceria, camara, lente, iluminacion, aleatorio): if aleatorio: role = random.choice(ROLES) lenceria = random.choice(LENCERIA) camara = random.choice(CAMARAS) lente = random.choice(LENTES) iluminacion = random.choice(ILUMINACION) prompt = ( f"{role}, {SUJETO}, {lenceria}, {MEDIAS}, {TACONES}, " f"{ESTILO}, {FORMATO}, {ANGULO}, shot with {camara} and {lente} using {iluminacion}." ) return prompt # Construcción del frontend con Gradio with gr.Blocks() as demo: gr.Markdown("# Generador de Prompts Fotográficos Hiperrealistas") with gr.Row(): with gr.Column(): role_input = gr.Dropdown(ROLES, label="Rol / Profesión", value=ROLES[0]) lenceria_input = gr.Dropdown(LENCERIA, label="Detalle de lencería", value=LENCERIA[0]) camara_input = gr.Dropdown(CAMARAS, label="Cámara", value=CAMARAS[0]) lente_input = gr.Dropdown(LENTES, label="Lente", value=LENTES[0]) iluminacion_input = gr.Dropdown(ILUMINACION, label="Iluminación", value=ILUMINACION[0]) aleatorio_input = gr.Checkbox(label="Generar aleatorio", value=False) btn = gr.Button("Generar Prompt") with gr.Column(): output = gr.Textbox(label="Prompt Generado", lines=6, show_copy_button=True) btn.click( fn=generar_prompt, inputs=[role_input, lenceria_input, camara_input, lente_input, iluminacion_input, aleatorio_input], outputs=output ) demo.launch()