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 intricate lace tops" TACONES = "elegant high heels appropriate for the profession" ESTILO = "hyperrealistic professional photography, 16K resolution, ultra sharp focus, detailed skin texture, anatomically correct proportions, subtle subsurface scattering, cinematic depth of field" FORMATO = "full body portrait, vertical composition, 9:16 aspect ratio, perfectly centered subject" COMPOSICION = "dynamic low-angle full-body shot from head to toe, subject completely visible, ample headroom and footroom, perfect framing" 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"] # Negative prompt fijo para evitar recortes NEGATIVE_PROMPT = ( "cropped, partial view, cut off, head cut off, feet cut off, incomplete body, " "out of frame, bad composition, tight crop, zoomed in too much, " "low resolution, blurry, deformed, extra limbs, missing limbs" ) # Función backend para generar ambos prompts 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) positive_prompt = ( f"A delicate-featured Latina woman with sensual soft curves as a {role}, " f"wearing {MEDIAS} and {TACONES}, {lenceria}, " f"{ESTILO}, {FORMATO}, {COMPOSICION}, " f"shot with {camara} and {lente} using {iluminacion}, " f"professional fashion photography, perfect composition, full subject in frame --ar 9:16" ) return positive_prompt, NEGATIVE_PROMPT # Construcción del frontend con Gradio with gr.Blocks() as demo: gr.Markdown("# Generador de Prompts Hiperrealistas (Cuerpo Completo Sin Recortes)") gr.Markdown("**Incluye Negative Prompt para evitar recortes**") 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 Prompts") with gr.Column(): positive_output = gr.Textbox(label="Prompt Positivo (copiar aquí)", lines=8, show_copy_button=True) negative_output = gr.Textbox(label="Negative Prompt (anti-recortes)", lines=3, show_copy_button=True, value=NEGATIVE_PROMPT) btn.click( fn=generar_prompt, inputs=[role_input, lenceria_input, camara_input, lente_input, iluminacion_input, aleatorio_input], outputs=[positive_output, negative_output] ) gr.Markdown("### Instrucciones:") gr.Markdown("- Usa **Prompt Positivo** en el campo principal.") gr.Markdown("- Usa **Negative Prompt** en el campo de *negative prompt* (si tu herramienta lo soporta).") gr.Markdown("- En Midjourney: pega el positivo y añade `--ar 9:16` al final.") demo.launch()