Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,43 +99,38 @@ class FashionPromptGenerator:
|
|
| 99 |
"""Limpia el historial de prompts generados."""
|
| 100 |
self.previous_prompts.clear()
|
| 101 |
|
|
|
|
| 102 |
custom_css = """
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
.generate-btn {
|
| 124 |
-
background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
|
| 125 |
-
color: white;
|
| 126 |
-
border: none;
|
| 127 |
-
}
|
| 128 |
-
.clear-btn {
|
| 129 |
-
background: #718096;
|
| 130 |
-
color: white;
|
| 131 |
-
border: none;
|
| 132 |
-
}
|
| 133 |
"""
|
| 134 |
|
| 135 |
def create_gradio_interface():
|
| 136 |
generator = FashionPromptGenerator()
|
| 137 |
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
gr.Markdown("""
|
| 141 |
# 🎭 Advanced Fashion Prompt Generator
|
|
@@ -154,8 +149,8 @@ def create_gradio_interface():
|
|
| 154 |
label="Number of Prompts to Generate"
|
| 155 |
)
|
| 156 |
with gr.Column(scale=1):
|
| 157 |
-
generate_btn = gr.Button("✨ Generate Prompts", variant="primary"
|
| 158 |
-
clear_btn = gr.Button("🗑️ Clear History", variant="secondary"
|
| 159 |
|
| 160 |
gr.Markdown("---")
|
| 161 |
|
|
@@ -166,9 +161,8 @@ def create_gradio_interface():
|
|
| 166 |
value=negative_prompt_fusion,
|
| 167 |
label="",
|
| 168 |
lines=4,
|
| 169 |
-
interactive=False
|
| 170 |
-
|
| 171 |
-
)
|
| 172 |
|
| 173 |
gr.Markdown("## Generated Prompts")
|
| 174 |
|
|
@@ -183,8 +177,7 @@ def create_gradio_interface():
|
|
| 183 |
label="",
|
| 184 |
lines=12,
|
| 185 |
max_lines=15,
|
| 186 |
-
interactive=False,
|
| 187 |
-
elem_classes="prompt-box",
|
| 188 |
show_copy_button=True
|
| 189 |
)
|
| 190 |
output_columns.append(col)
|
|
|
|
| 99 |
"""Limpia el historial de prompts generados."""
|
| 100 |
self.previous_prompts.clear()
|
| 101 |
|
| 102 |
+
# CSS como string separado
|
| 103 |
custom_css = """
|
| 104 |
+
.prompt-box {
|
| 105 |
+
border: 1px solid #e2e8f0;
|
| 106 |
+
border-radius: 8px;
|
| 107 |
+
padding: 16px;
|
| 108 |
+
margin-bottom: 16px;
|
| 109 |
+
background-color: #f8fafc;
|
| 110 |
+
font-family: 'Monaco', 'Consolas', monospace;
|
| 111 |
+
font-size: 0.9em;
|
| 112 |
+
white-space: pre-wrap;
|
| 113 |
+
word-wrap: break-word;
|
| 114 |
+
}
|
| 115 |
+
.prompt-title {
|
| 116 |
+
font-weight: bold;
|
| 117 |
+
margin-bottom: 8px;
|
| 118 |
+
color: #4a5568;
|
| 119 |
+
}
|
| 120 |
+
.header {
|
| 121 |
+
text-align: center;
|
| 122 |
+
margin-bottom: 20px;
|
| 123 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
"""
|
| 125 |
|
| 126 |
def create_gradio_interface():
|
| 127 |
generator = FashionPromptGenerator()
|
| 128 |
|
| 129 |
+
# Usar Blocks sin el parámetro css y theme
|
| 130 |
+
with gr.Blocks() as demo:
|
| 131 |
+
|
| 132 |
+
# Inyectar CSS usando gr.HTML
|
| 133 |
+
gr.HTML(f"<style>{custom_css}</style>")
|
| 134 |
|
| 135 |
gr.Markdown("""
|
| 136 |
# 🎭 Advanced Fashion Prompt Generator
|
|
|
|
| 149 |
label="Number of Prompts to Generate"
|
| 150 |
)
|
| 151 |
with gr.Column(scale=1):
|
| 152 |
+
generate_btn = gr.Button("✨ Generate Prompts", variant="primary")
|
| 153 |
+
clear_btn = gr.Button("🗑️ Clear History", variant="secondary")
|
| 154 |
|
| 155 |
gr.Markdown("---")
|
| 156 |
|
|
|
|
| 161 |
value=negative_prompt_fusion,
|
| 162 |
label="",
|
| 163 |
lines=4,
|
| 164 |
+
interactive=False
|
| 165 |
+
).style(container=False)
|
|
|
|
| 166 |
|
| 167 |
gr.Markdown("## Generated Prompts")
|
| 168 |
|
|
|
|
| 177 |
label="",
|
| 178 |
lines=12,
|
| 179 |
max_lines=15,
|
| 180 |
+
interactive=False,
|
|
|
|
| 181 |
show_copy_button=True
|
| 182 |
)
|
| 183 |
output_columns.append(col)
|