Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,10 @@ import logging
|
|
6 |
import sys
|
7 |
import random
|
8 |
import time
|
|
|
9 |
from huggingface_hub import InferenceClient
|
10 |
from PIL import Image
|
11 |
import io
|
12 |
-
import os
|
13 |
import base64
|
14 |
|
15 |
# Set up logging
|
@@ -1253,26 +1253,6 @@ def create_ui():
|
|
1253 |
elem_classes="char-counter-container"
|
1254 |
)
|
1255 |
|
1256 |
-
# Examples gallery with clear visual structure
|
1257 |
-
with gr.Group(elem_classes="examples-group"):
|
1258 |
-
gr.HTML("<h3 style='margin-top: 0; font-size: 1rem; margin-bottom: 0.75rem;'>🌟 Try an example:</h3>")
|
1259 |
-
|
1260 |
-
# Gallery of examples
|
1261 |
-
with gr.Row(elem_classes="example-gallery"):
|
1262 |
-
for i, example in enumerate(EXAMPLE_PROMPTS):
|
1263 |
-
with gr.Column(elem_classes="example-item"):
|
1264 |
-
# Example card with visual element and caption
|
1265 |
-
example_card = gr.Button(
|
1266 |
-
example["thumbnail_desc"],
|
1267 |
-
elem_classes="example-button"
|
1268 |
-
)
|
1269 |
-
|
1270 |
-
# Event handler for example selection
|
1271 |
-
example_card.click(
|
1272 |
-
fn=lambda idx=i: load_example(idx),
|
1273 |
-
outputs=[description_input, creation_type, art_style, mood_dropdown]
|
1274 |
-
)
|
1275 |
-
|
1276 |
# Creation settings with enhanced dropdowns
|
1277 |
with gr.Group(elem_classes="settings-group"):
|
1278 |
gr.HTML("<h3 style='margin-top: 0; font-size: 1rem; margin-bottom: 0.75rem;'>🛠️ Image Settings</h3>")
|
@@ -1314,6 +1294,26 @@ def create_ui():
|
|
1314 |
elem_classes="enhanced-dropdown"
|
1315 |
)
|
1316 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1317 |
# Information panels for selected options
|
1318 |
with gr.Group(elem_classes="info-panels"):
|
1319 |
# Creation type info
|
|
|
6 |
import sys
|
7 |
import random
|
8 |
import time
|
9 |
+
import os
|
10 |
from huggingface_hub import InferenceClient
|
11 |
from PIL import Image
|
12 |
import io
|
|
|
13 |
import base64
|
14 |
|
15 |
# Set up logging
|
|
|
1253 |
elem_classes="char-counter-container"
|
1254 |
)
|
1255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1256 |
# Creation settings with enhanced dropdowns
|
1257 |
with gr.Group(elem_classes="settings-group"):
|
1258 |
gr.HTML("<h3 style='margin-top: 0; font-size: 1rem; margin-bottom: 0.75rem;'>🛠️ Image Settings</h3>")
|
|
|
1294 |
elem_classes="enhanced-dropdown"
|
1295 |
)
|
1296 |
|
1297 |
+
# Examples gallery with clear visual structure
|
1298 |
+
with gr.Group(elem_classes="examples-group"):
|
1299 |
+
gr.HTML("<h3 style='margin-top: 0; font-size: 1rem; margin-bottom: 0.75rem;'>🌟 Try an example:</h3>")
|
1300 |
+
|
1301 |
+
# Gallery of examples
|
1302 |
+
with gr.Row(elem_classes="example-gallery"):
|
1303 |
+
for i, example in enumerate(EXAMPLE_PROMPTS):
|
1304 |
+
with gr.Column(elem_classes="example-item"):
|
1305 |
+
# Example card with visual element and caption
|
1306 |
+
example_card = gr.Button(
|
1307 |
+
example["thumbnail_desc"],
|
1308 |
+
elem_classes="example-button"
|
1309 |
+
)
|
1310 |
+
|
1311 |
+
# Event handler for example selection
|
1312 |
+
example_card.click(
|
1313 |
+
fn=lambda idx=i: load_example(idx),
|
1314 |
+
outputs=[description_input, creation_type, art_style, mood_dropdown]
|
1315 |
+
)
|
1316 |
+
|
1317 |
# Information panels for selected options
|
1318 |
with gr.Group(elem_classes="info-panels"):
|
1319 |
# Creation type info
|