Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,7 @@ class PromptGenerator:
|
|
| 48 |
"sensual model": "designer evening gown with thigh slit, thigh-high stockings, luxury lace panties showcased during photo shoot poses, no bra, runway heels",
|
| 49 |
"alluring secretary": "bodycon dress and blazer, thigh-high stockings, lace panties clearly outlined beneath fabric, no bra, stiletto pumps",
|
| 50 |
"elegant flight attendant": "modern uniform with scarf, thigh-high stockings, lace panties subtly visible during boarding gestures, no bra, airline heels",
|
| 51 |
-
"seductive maid": "traditional french maid costume shortened, thigh-high stockings, lace panties prominently displayed during cleaning poses, no bra,mary janes",
|
| 52 |
"mysterious nurse": "night shift uniform with cape, thigh-high stockings, lace panties revealed during urgent movements, no bra, silent shoes",
|
| 53 |
"captivating schoolgirl": "a short skirt and blouse with thigh-high stockings, classic black lace panties slipping into view, no bra, black patent heels",
|
| 54 |
"business executive": "power suit with mini skirt, thigh-high stockings, luxury lace panties visible during confident walking, no bra, executive heels",
|
|
@@ -114,7 +114,6 @@ class PromptGenerator:
|
|
| 114 |
f"Pose: {pose}. Scene: {setting}. Atmosphere: {atmosphere}. "
|
| 115 |
f"{self.TECHNICAL_DETAILS}"
|
| 116 |
)
|
| 117 |
-
# CORRECCIÓN: Devolver el prompt real.
|
| 118 |
return prompt
|
| 119 |
|
| 120 |
def generate_five_prompts(self) -> List[str]:
|
|
@@ -127,18 +126,16 @@ def generate_prompts_list():
|
|
| 127 |
generator = PromptGenerator()
|
| 128 |
return generator.generate_five_prompts()
|
| 129 |
|
| 130 |
-
|
| 131 |
# --- Definición de la interfaz de usuario con Acordeones ---
|
| 132 |
|
| 133 |
-
PROMPT_COUNT = 5
|
| 134 |
|
| 135 |
with gr.Blocks() as demo:
|
| 136 |
gr.Markdown("# Hyperrealistic Full-Body Prompt Generator")
|
| 137 |
|
| 138 |
# Crea una lista de Textbox para mostrar cada prompt individualmente
|
| 139 |
-
# Se añade show_copy_button=True para el botón de copia fácil
|
| 140 |
prompt_outputs = [gr.Textbox(label=f"Prompt {i+1}", lines=5, interactive=False, show_copy_button=True)
|
| 141 |
-
|
| 142 |
|
| 143 |
button = gr.Button("Generate 5 Prompts")
|
| 144 |
|
|
@@ -149,21 +146,15 @@ with gr.Blocks() as demo:
|
|
| 149 |
|
| 150 |
# Itera para crear 5 acordeones
|
| 151 |
for i in range(PROMPT_COUNT):
|
| 152 |
-
# El componente gr.Accordion se usa para crear la estructura de acordeón.
|
| 153 |
with gr.Accordion(f"Prompt #{i+1} (Click para ver y copiar)", open=False):
|
| 154 |
-
#
|
| 155 |
-
prompt_outputs[i]
|
| 156 |
-
|
| 157 |
-
# La línea errónea se ha ELIMINADO.
|
| 158 |
-
# El botón de copia está en el Textbox de arriba.
|
| 159 |
|
| 160 |
# La acción del botón: llama a la función de generación y asigna la lista de resultados
|
| 161 |
-
# a la lista de Textboxes creados.
|
| 162 |
button.click(
|
| 163 |
fn=generate_prompts_list,
|
| 164 |
outputs=prompt_outputs
|
| 165 |
)
|
| 166 |
|
| 167 |
if __name__ == "__main__":
|
| 168 |
-
demo.launch()
|
| 169 |
-
|
|
|
|
| 48 |
"sensual model": "designer evening gown with thigh slit, thigh-high stockings, luxury lace panties showcased during photo shoot poses, no bra, runway heels",
|
| 49 |
"alluring secretary": "bodycon dress and blazer, thigh-high stockings, lace panties clearly outlined beneath fabric, no bra, stiletto pumps",
|
| 50 |
"elegant flight attendant": "modern uniform with scarf, thigh-high stockings, lace panties subtly visible during boarding gestures, no bra, airline heels",
|
| 51 |
+
"seductive maid": "traditional french maid costume shortened, thigh-high stockings, lace panties prominently displayed during cleaning poses, no bra, mary janes",
|
| 52 |
"mysterious nurse": "night shift uniform with cape, thigh-high stockings, lace panties revealed during urgent movements, no bra, silent shoes",
|
| 53 |
"captivating schoolgirl": "a short skirt and blouse with thigh-high stockings, classic black lace panties slipping into view, no bra, black patent heels",
|
| 54 |
"business executive": "power suit with mini skirt, thigh-high stockings, luxury lace panties visible during confident walking, no bra, executive heels",
|
|
|
|
| 114 |
f"Pose: {pose}. Scene: {setting}. Atmosphere: {atmosphere}. "
|
| 115 |
f"{self.TECHNICAL_DETAILS}"
|
| 116 |
)
|
|
|
|
| 117 |
return prompt
|
| 118 |
|
| 119 |
def generate_five_prompts(self) -> List[str]:
|
|
|
|
| 126 |
generator = PromptGenerator()
|
| 127 |
return generator.generate_five_prompts()
|
| 128 |
|
|
|
|
| 129 |
# --- Definición de la interfaz de usuario con Acordeones ---
|
| 130 |
|
| 131 |
+
PROMPT_COUNT = 5 # Cantidad de prompts a generar
|
| 132 |
|
| 133 |
with gr.Blocks() as demo:
|
| 134 |
gr.Markdown("# Hyperrealistic Full-Body Prompt Generator")
|
| 135 |
|
| 136 |
# Crea una lista de Textbox para mostrar cada prompt individualmente
|
|
|
|
| 137 |
prompt_outputs = [gr.Textbox(label=f"Prompt {i+1}", lines=5, interactive=False, show_copy_button=True)
|
| 138 |
+
for i in range(PROMPT_COUNT)]
|
| 139 |
|
| 140 |
button = gr.Button("Generate 5 Prompts")
|
| 141 |
|
|
|
|
| 146 |
|
| 147 |
# Itera para crear 5 acordeones
|
| 148 |
for i in range(PROMPT_COUNT):
|
|
|
|
| 149 |
with gr.Accordion(f"Prompt #{i+1} (Click para ver y copiar)", open=False):
|
| 150 |
+
# Simplemente referencia el Textbox, sin llamar a .render()
|
| 151 |
+
prompt_outputs[i]
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
# La acción del botón: llama a la función de generación y asigna la lista de resultados
|
|
|
|
| 154 |
button.click(
|
| 155 |
fn=generate_prompts_list,
|
| 156 |
outputs=prompt_outputs
|
| 157 |
)
|
| 158 |
|
| 159 |
if __name__ == "__main__":
|
| 160 |
+
demo.launch()
|
|
|