Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -204,7 +204,15 @@ def gerar_post_interface(tema, nicho, estilo, descricao_imagem, gerar_img):
|
|
| 204 |
# INTERFACE GRADIO
|
| 205 |
# ============================================
|
| 206 |
|
| 207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
gr.Markdown("""
|
| 210 |
# 🚀 Gerador de Posts para Redes Sociais
|
|
@@ -245,9 +253,10 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Gerador de Posts") as demo:
|
|
| 245 |
)
|
| 246 |
|
| 247 |
descricao_img_input = gr.Textbox(
|
| 248 |
-
label="Descrição da
|
| 249 |
-
placeholder="Ex:
|
| 250 |
visible=False # Só aparece se gerar_img_checkbox for marcado
|
|
|
|
| 251 |
)
|
| 252 |
|
| 253 |
def toggle_descricao_img(gerar):
|
|
@@ -259,7 +268,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Gerador de Posts") as demo:
|
|
| 259 |
inputs=[gerar_img_checkbox],
|
| 260 |
outputs=[descricao_img_input]
|
| 261 |
)
|
| 262 |
-
|
| 263 |
gerar_btn = gr.Button("✨ Gerar Post", variant="primary")
|
| 264 |
|
| 265 |
with gr.Column(scale=1):
|
|
@@ -308,6 +317,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Gerador de Posts") as demo:
|
|
| 308 |
inputs=[tema_input, nicho_input, estilo_input, descricao_img_input, gerar_img_checkbox],
|
| 309 |
# Ordem CORRETA para a função retornar (texto, imagem, status_final)
|
| 310 |
outputs=[texto_output, imagem_output, status_output]
|
|
|
|
| 311 |
)
|
| 312 |
|
| 313 |
# ABA 2: Histórico
|
|
@@ -342,7 +352,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Gerador de Posts") as demo:
|
|
| 342 |
3. IAs processam e geram conteúdo
|
| 343 |
4. Resultado aparece instantaneamente
|
| 344 |
|
| 345 |
-
**Desenvolvido por:**
|
| 346 |
""")
|
| 347 |
|
| 348 |
# Footer
|
|
|
|
| 204 |
# INTERFACE GRADIO
|
| 205 |
# ============================================
|
| 206 |
|
| 207 |
+
tema_custom = gr.themes.Glass(
|
| 208 |
+
primary_hue="blue", # Cor primária
|
| 209 |
+
secondary_hue="purple", # Cor secundária
|
| 210 |
+
neutral_hue="slate", # Cor neutra
|
| 211 |
+
font=["Helvetica", "sans-serif"]
|
| 212 |
+
)
|
| 213 |
+
|
| 214 |
+
with gr.Blocks(theme=tema_custom, title="Gerador de Posts") as demo:
|
| 215 |
+
# with gr.Blocks(theme=gr.themes.Glass(), title="Gerador de Posts") as demo:
|
| 216 |
|
| 217 |
gr.Markdown("""
|
| 218 |
# 🚀 Gerador de Posts para Redes Sociais
|
|
|
|
| 253 |
)
|
| 254 |
|
| 255 |
descricao_img_input = gr.Textbox(
|
| 256 |
+
label="Descrição da Imagem (em inglês)",
|
| 257 |
+
placeholder="Ex: person exercising at gym, motivated",
|
| 258 |
visible=False # Só aparece se gerar_img_checkbox for marcado
|
| 259 |
+
info="Descreva o que deve aparecer na imagem"
|
| 260 |
)
|
| 261 |
|
| 262 |
def toggle_descricao_img(gerar):
|
|
|
|
| 268 |
inputs=[gerar_img_checkbox],
|
| 269 |
outputs=[descricao_img_input]
|
| 270 |
)
|
| 271 |
+
|
| 272 |
gerar_btn = gr.Button("✨ Gerar Post", variant="primary")
|
| 273 |
|
| 274 |
with gr.Column(scale=1):
|
|
|
|
| 317 |
inputs=[tema_input, nicho_input, estilo_input, descricao_img_input, gerar_img_checkbox],
|
| 318 |
# Ordem CORRETA para a função retornar (texto, imagem, status_final)
|
| 319 |
outputs=[texto_output, imagem_output, status_output]
|
| 320 |
+
show_progress="full" # Barra de progresso completa
|
| 321 |
)
|
| 322 |
|
| 323 |
# ABA 2: Histórico
|
|
|
|
| 352 |
3. IAs processam e geram conteúdo
|
| 353 |
4. Resultado aparece instantaneamente
|
| 354 |
|
| 355 |
+
**Desenvolvido por:** Wilde Paz
|
| 356 |
""")
|
| 357 |
|
| 358 |
# Footer
|