Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
# --- Datos base ---
|
| 5 |
+
ROLES = [
|
| 6 |
+
"Executive Secretary", "Luxury Hotel Manager", "Fashion Boutique Manager", "Corporate Lawyer",
|
| 7 |
+
"Private Jet Attendant", "Art Gallery Curator", "University Professor", "Wine Sommelier",
|
| 8 |
+
"Ballet Instructor", "Yacht Stewardess", "Casino Dealer", "News Anchor", "Elegant Maid",
|
| 9 |
+
"Flight Attendant", "Sensual Nun", "Police Officer", "Military Officer", "Nurse", "Schoolgirl",
|
| 10 |
+
"Fitness Instructor", "Yoga Practitioner", "Salsa Dancer", "Telenovela Actress", "Latin Chef",
|
| 11 |
+
"Fiesta Organizer", "Latin Sommelier", "Flamenco Guitarist", "Latin Diplomat", "Mariachi Singer",
|
| 12 |
+
"Latin Curator", "Samba Instructor", "1960s WAC Officer", "Vietnam Era Military Nurse",
|
| 13 |
+
"1980s Air Force Pilot", "1990s Army General", "2000s Marine Corps Captain",
|
| 14 |
+
"2010s Cyber Warfare Specialist", "2020s Special Forces Operator", "Artemis Program Commander",
|
| 15 |
+
"1960s WAVES Ensign", "1970s Navy Aviator", "1980s Submarine Officer", "1990s Naval Intelligence Analyst"
|
| 16 |
+
]
|
| 17 |
+
|
| 18 |
+
LENCERIA = [
|
| 19 |
+
"a subtle glimpse of a lace thong above her waistband as she bends over",
|
| 20 |
+
"a hint of a lace thong visible as she sits down",
|
| 21 |
+
"the outline of a g-string visible through her uniform as she stretches",
|
| 22 |
+
"a peek of a black lace thong as her skirt naturally moves"
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
MEDIAS = "thigh-high stockings with detailed lace texture"
|
| 26 |
+
TACONES = "elegant high heels appropriate for the profession"
|
| 27 |
+
|
| 28 |
+
ESTILO = "hyperrealistic professional photography, 16K, sharp focus, detailed skin texture, anatomically correct, subtle subsurface scattering"
|
| 29 |
+
FORMATO = "full body vertical shot, 9:16 aspect ratio"
|
| 30 |
+
ANGULO = "low-angle view from knees up"
|
| 31 |
+
SUJETO = "delicate-featured Latina woman, sensual body with soft curves"
|
| 32 |
+
|
| 33 |
+
CAMARAS = ["Canon EOS R5", "Sony 伪7R V", "Nikon Z9"]
|
| 34 |
+
LENTES = ["85mm f/1.2 lens", "50mm f/1.4 portrait lens"]
|
| 35 |
+
ILUMINACION = ["professional studio lighting", "golden hour sunlight", "soft natural window light"]
|
| 36 |
+
|
| 37 |
+
# Funci贸n backend para generar el prompt
|
| 38 |
+
def generar_prompt(role, lenceria, camara, lente, iluminacion, aleatorio):
|
| 39 |
+
if aleatorio:
|
| 40 |
+
role = random.choice(ROLES)
|
| 41 |
+
lenceria = random.choice(LENCERIA)
|
| 42 |
+
camara = random.choice(CAMARAS)
|
| 43 |
+
lente = random.choice(LENTES)
|
| 44 |
+
iluminacion = random.choice(ILUMINACION)
|
| 45 |
+
|
| 46 |
+
prompt = (
|
| 47 |
+
f"{role}, {SUJETO}, {lenceria}, {MEDIAS}, {TACONES}, "
|
| 48 |
+
f"{ESTILO}, {FORMATO}, {ANGULO}, shot with {camara} and {lente} using {iluminacion}."
|
| 49 |
+
)
|
| 50 |
+
return prompt
|
| 51 |
+
|
| 52 |
+
# Construcci贸n del frontend con Gradio
|
| 53 |
+
with gr.Blocks() as demo:
|
| 54 |
+
gr.Markdown("# Generador de Prompts Fotogr谩ficos Hiperrealistas")
|
| 55 |
+
with gr.Row():
|
| 56 |
+
with gr.Column():
|
| 57 |
+
role_input = gr.Dropdown(ROLES, label="Rol / Profesi贸n", value=ROLES[0])
|
| 58 |
+
lenceria_input = gr.Dropdown(LENCERIA, label="Detalle de lencer铆a", value=LENCERIA[0])
|
| 59 |
+
camara_input = gr.Dropdown(CAMARAS, label="C谩mara", value=CAMARAS[0])
|
| 60 |
+
lente_input = gr.Dropdown(LENTES, label="Lente", value=LENTES[0])
|
| 61 |
+
iluminacion_input = gr.Dropdown(ILUMINACION, label="Iluminaci贸n", value=ILUMINACION[0])
|
| 62 |
+
aleatorio_input = gr.Checkbox(label="Generar aleatorio", value=False)
|
| 63 |
+
btn = gr.Button("Generar Prompt")
|
| 64 |
+
with gr.Column():
|
| 65 |
+
output = gr.Textbox(label="Prompt Generado", lines=6, show_copy_button=True)
|
| 66 |
+
|
| 67 |
+
btn.click(
|
| 68 |
+
fn=generar_prompt,
|
| 69 |
+
inputs=[role_input, lenceria_input, camara_input, lente_input, iluminacion_input, aleatorio_input],
|
| 70 |
+
outputs=output
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
demo.launch()
|