BATUTO-ART's picture
Update app.py
d0e8e7e verified
import gradio as gr
import random
from data import fashion_elements, PhotoReal
# ==========================================================
# GENERADOR DE PROMPTS PRO++
# ==========================================================
def generar_prompts_para_web(nombre_sujeto, cantidad):
if not nombre_sujeto or nombre_sujeto.strip() == "":
nombre_sujeto = "BATUTO"
cantidad = int(cantidad) if cantidad else 5
if cantidad > 20:
cantidad = 20
resultados = []
for i in range(cantidad):
cuerpo = random.choice(PhotoReal.BODY)
rol = random.choice(PhotoReal.ROLES)
pelo = random.choice(fashion_elements["hairstyles"])
color = random.choice(fashion_elements["colors"])
revelacion = random.choice(fashion_elements["lingerie_reveal_actions"])
lenceria = random.choice(fashion_elements["lingerie_sets"])
fondo = random.choice(fashion_elements["backgrounds"])
luz = random.choice(fashion_elements["lighting"])
angulo = random.choice(fashion_elements["voyeuristic_angles"])
expresion = random.choice(fashion_elements["expressions"])
prompt = f"""
PROMPT #{i+1}
Photorealistic portrait of {nombre_sujeto}, {angulo}, {cuerpo},
acting as a {rol['role']} wearing {rol['outfit']} in {color} tones,
{pelo}, {expresion}, {revelacion}, subtly showing details of {lenceria},
location {fondo}, {luz},
ultra-detailed skin textures, realistic anatomy, 8k resolution,
cinematic lighting, shallow depth of field, sharp focus,
professional photography, masterpiece.
""".strip()
resultados.append(prompt)
# Rellenamos hasta 20 para que Gradio no falle
while len(resultados) < 20:
resultados.append("")
return resultados
# ==========================================================
# INTERFAZ PRO++
# ==========================================================
with gr.Blocks(title="🔥 BATUTO CREATE PRO++ 🔥") as demo:
gr.Markdown(
"""
# 🔥 BATUTO CREATE PRO++ 🔥
### Un prompt = un cuadro = copiar directo
Modo profesional activado 😈
"""
)
with gr.Row():
inp_nombre = gr.Textbox(
label="Nombre del Sujeto",
value="BATUTO"
)
inp_cantidad = gr.Slider(
minimum=1,
maximum=20,
value=5,
step=1,
label="Cantidad de Prompts"
)
btn_generar = gr.Button("🚀 Generar Prompts PRO++", variant="primary")
# 🔥 20 cuadros independientes (cada uno con botón copiar)
outputs = []
for i in range(20):
with gr.Accordion(f"Prompt #{i+1}", open=i < 5):
code = gr.Code(
label=f"Prompt #{i+1}",
language="markdown"
)
outputs.append(code)
btn_generar.click(
fn=generar_prompts_para_web,
inputs=[inp_nombre, inp_cantidad],
outputs=outputs
)
if __name__ == "__main__":
demo.launch()