import random import gradio as gr import re # Diccionario de prompts detallados por escenario PROMPT_SCENARIOS = { "OFFICE SECRETARY": [ "an elegant office secretary is organizing a bookshelf, a black thong is subtly visible under her white mini skirt, the camera captures the scene from a low-angle shot, from a voyeuristic POV, she looks directly at the viewer with an ecstatic expression of pleasure and desire, soft cinematic lighting, perfect illumination on the thong area, no shadows or artifacts, masterpiece, best quality, Ultra HD 16K, professional color photograph.", "a secretary is leaning over a photocopier, her tight red mini skirt rides up, revealing a matching red lace thong peeking out, the camera angle is a nadir shot, pointing up from the ground, she turns her head to look at the viewer with a fiery gaze and an expression of pure ecstasy, soft and perfect lighting focused on her legs and the thong, clean background, masterpiece, best quality, Ultra HD 16K, professional color photograph.", "an office assistant is sitting on her desk, crossing her legs, a delicate string thong is perfectly visible beneath her short pencil skirt, the camera angle is a low-angle, looking up from the floor, she has a seductive smile and her eyes are half-closed in a state of bliss, perfectly even lighting across the entire frame, no shadows or sharp edges, masterpiece, best quality, Ultra HD 16K, professional color photograph." ], "SCHOOLGIRL UNIFORM": [ "a schoolgirl is leaning over a classroom desk, a delicate thong is accidentally visible under her pleated skirt, the camera is on the floor looking up (worm's-eye view), she makes eye contact with the viewer with a sensual gaze and an expression of a subtle orgasm, perfect studio lighting, no distracting elements, clean background, masterpiece, best quality, Ultra HD 16K, professional color photograph.", "a student is crouching to pick up a book from the floor, her tartan mini skirt slides up to reveal a silky white thong, the camera is at a nadir angle (looking up), she glances back with a playful look and an expression of intense pleasure, bright and even illumination, perfect lighting on the thong and her legs, no annoying shadows, masterpiece, best quality, Ultra HD 16K, professional color photograph.", "a schoolgirl is climbing stairs, her school skirt rises to reveal a thin black thong, captured with a contrapicado angle from below, her head is turned with a look of pure delight, direct eye contact with the viewer, perfect frontal lighting, no dark spots or unpleasant borders, masterpiece, best quality, Ultra HD 16K, professional color photograph." ], "LINGERIE AND MINI SKIRT": [ "a beautiful woman in a black pleated silk mini skirt is sitting on the edge of the bed, her red lace thong is accidentally visible, the camera is positioned from a nadir angle, low angle perspective, she looks directly at the viewer with a look of pure desire and a hint of ecstasy on her face, bright soft-box lighting, perfect illumination on the thong, cinematic, no blurry edges, masterpiece, best quality, Ultra HD 16K, professional color photograph.", "a model is leaning against a wall, a strong wind lifts her short skirt to reveal a sexy lace thong, captured from a contrapicado angle, she stares at the camera with a challenging gaze and an expression of pleasure on her face, bright lighting focused on the folds of the skirt and the thong, no distracting shadows, masterpiece, best quality, Ultra HD 16K, professional color photograph.", "a sensual figure is standing with hands on head, her mini skirt lifted simulating carelessness and the thong is exposed, captured from a low angle, she looks at the viewer with a seductive expression of ecstasy, perfect illumination to highlight her form, soft focus, no harsh lines, masterpiece, best quality, Ultra HD 16K, professional color photograph." ], "CELEBRITY PHOTO SHOOT": [ "professional ultra-high resolution photograph, medium full shot (from knees up) in a 9:16 vertical format, filling the entire frame. Camera angles: low angle and extreme nadir view (from the ground). The subject looks directly at the camera with confidence and power. She wears an elegant and sensual lace lingerie set. Professional soft, shadowless studio lighting with an ARRI SkyPanel, highlighting skin texture and lace. Sharp, dramatic focus on the eyes. Cinematic, powerful, and dramatic style. shot on Canon EOS R5, Canon RF 85mm f/1.2L --style raw --ar 9:16" ] } # Descriptores para la composición de la imagen IMAGE_COMPOSITION = "(masterpiece, best quality:1.4), Ultra HD 16K (15360 × 8640), professional color photograph," IMAGE_COMPOSITION_CELEBRITY = "--style raw --ar 9:16" # --- Función para generar prompts --- def generate_prompts(celebrity_name: str, num_prompts: int = 5): """ Genera una lista de prompts aleatorios, cada uno con el nombre de la celebridad. """ # Recolectar todos los prompts base de los escenarios, excluyendo 'CELEBRITY PHOTO SHOOT' all_prompts = [] for scenario in PROMPT_SCENARIOS: if scenario != "CELEBRITY PHOTO SHOOT": all_prompts.extend(PROMPT_SCENARIOS[scenario]) # Elegir 5 prompts únicos de la lista combinada if len(all_prompts) < num_prompts: chosen_prompts = all_prompts else: chosen_prompts = random.sample(all_prompts, num_prompts) # Formatear cada prompt con el nombre de la celebridad y las composiciones final_prompts = [] for prompt in chosen_prompts: # Reemplazar "a schoolgirl", "a secretary", etc. con el nombre de la celebridad prompt_with_celebrity = re.sub(r'a (schoolgirl|secretary|assistant|student|model|beautiful woman|sensual figure)', celebrity_name, prompt, flags=re.IGNORECASE) final_prompt = f"({celebrity_name}), {IMAGE_COMPOSITION} {prompt_with_celebrity}" final_prompts.append(final_prompt) return final_prompts # --- Interfaz de Gradio --- with gr.Blocks(theme="huggingface", title="BATUPROMT V5.0") as demo: gr.Markdown("# Generador de Prompts v2.0") gr.Markdown("Ingresa el nombre de una celebridad y presiona **Generar** para obtener 5 prompts aleatorios y únicos. Puedes copiar cada prompt fácilmente con el botón que aparece en la parte superior derecha de cada cuadro de texto. ✨") # Campo de entrada para el nombre de la celebridad celebrity_input = gr.Textbox( label="Nombre de la Celebridad", placeholder="ej. Ana de Armas", interactive=True ) # Botón para activar la generación generate_button = gr.Button("Generar Prompts") # Contenedores para los 5 prompts de salida prompt_outputs = [] for i in range(5): prompt_output = gr.Textbox( label=f"Prompt #{i+1}", lines=5, interactive=True, show_copy_button=True # Agrega esta línea para el botón de copiar ) prompt_outputs.append(prompt_output) # Conectar la función de generación con los elementos de la interfaz generate_button.click( fn=generate_prompts, inputs=[celebrity_input], outputs=prompt_outputs ) if __name__ == "__main__": demo.launch()