Better UI.
Browse files
app.py
CHANGED
|
@@ -320,61 +320,88 @@ def change_text_model(model_name: str=MODEL_PATH, use_client: bool=False, gguf_f
|
|
| 320 |
# Custom CSS for neon purple theme
|
| 321 |
css = """
|
| 322 |
body {
|
| 323 |
-
background: linear-gradient(
|
| 324 |
-
color: #
|
|
|
|
| 325 |
}
|
| 326 |
.gradio-container {
|
| 327 |
max-width: 1200px !important;
|
| 328 |
margin: auto;
|
| 329 |
}
|
| 330 |
.gr-button {
|
| 331 |
-
background
|
| 332 |
-
border
|
| 333 |
color: white !important;
|
|
|
|
|
|
|
| 334 |
}
|
| 335 |
.gr-button:hover {
|
| 336 |
-
background
|
|
|
|
| 337 |
}
|
| 338 |
.gr-form {
|
| 339 |
border-radius: 15px;
|
| 340 |
padding: 20px;
|
| 341 |
-
background-color:
|
| 342 |
-
box-shadow: 0
|
|
|
|
| 343 |
}
|
| 344 |
.gr-box {
|
| 345 |
border-radius: 15px;
|
| 346 |
-
background-color:
|
| 347 |
-
box-shadow: 0
|
|
|
|
| 348 |
}
|
| 349 |
.gr-padded {
|
| 350 |
padding: 20px;
|
| 351 |
}
|
| 352 |
.gr-form label, .gr-form .label-wrap {
|
| 353 |
-
color: #
|
|
|
|
| 354 |
}
|
| 355 |
.gr-input, .gr-dropdown {
|
| 356 |
-
background-color:
|
| 357 |
-
border
|
| 358 |
-
color: #
|
|
|
|
| 359 |
}
|
| 360 |
.gr-input::placeholder {
|
| 361 |
-
color: #
|
| 362 |
}
|
| 363 |
.gr-checkbox {
|
| 364 |
-
background-color: #
|
| 365 |
-
border-color: #
|
| 366 |
}
|
| 367 |
.gr-checkbox:checked {
|
| 368 |
-
background-color: #
|
| 369 |
}
|
| 370 |
h1, h2, h3 {
|
| 371 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 372 |
}
|
| 373 |
"""
|
| 374 |
|
| 375 |
# Gradio interface
|
| 376 |
-
with gr.Blocks(css=css) as demo:
|
| 377 |
-
gr.HTML(
|
|
|
|
|
|
|
|
|
|
| 378 |
with gr.Row():
|
| 379 |
with gr.Column(scale=1):
|
| 380 |
with gr.Group():
|
|
@@ -397,9 +424,9 @@ with gr.Blocks(css=css) as demo:
|
|
| 397 |
value="any",
|
| 398 |
)
|
| 399 |
gr.Markdown("**Note:** Caption tone doesn't affect `rng-tags` and `training_prompt`.")
|
| 400 |
-
with gr.Accordion("Advanced", open=False):
|
| 401 |
with gr.Row():
|
| 402 |
-
jc_text_model = gr.Dropdown(label="LLM Model", info="You can enter a
|
| 403 |
choices=get_text_model(), value=get_text_model()[0],
|
| 404 |
allow_custom_value=True, interactive=True, min_width=320)
|
| 405 |
jc_gguf = gr.Dropdown(label=f"GGUF Filename", choices=[], value="",
|
|
|
|
| 320 |
# Custom CSS for neon purple theme
|
| 321 |
css = """
|
| 322 |
body {
|
| 323 |
+
background: linear-gradient(45deg, #1a0033, #4d0099);
|
| 324 |
+
color: #e6ccff;
|
| 325 |
+
font-family: 'Arial', sans-serif;
|
| 326 |
}
|
| 327 |
.gradio-container {
|
| 328 |
max-width: 1200px !important;
|
| 329 |
margin: auto;
|
| 330 |
}
|
| 331 |
.gr-button {
|
| 332 |
+
background: linear-gradient(90deg, #8a2be2, #9400d3) !important;
|
| 333 |
+
border: none !important;
|
| 334 |
color: white !important;
|
| 335 |
+
font-weight: bold;
|
| 336 |
+
transition: all 0.3s ease;
|
| 337 |
}
|
| 338 |
.gr-button:hover {
|
| 339 |
+
background: linear-gradient(90deg, #9400d3, #8a2be2) !important;
|
| 340 |
+
box-shadow: 0 0 15px #9400d3;
|
| 341 |
}
|
| 342 |
.gr-form {
|
| 343 |
border-radius: 15px;
|
| 344 |
padding: 20px;
|
| 345 |
+
background-color: rgba(60, 19, 97, 0.7) !important;
|
| 346 |
+
box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
|
| 347 |
+
backdrop-filter: blur(10px);
|
| 348 |
}
|
| 349 |
.gr-box {
|
| 350 |
border-radius: 15px;
|
| 351 |
+
background-color: rgba(75, 0, 130, 0.7) !important;
|
| 352 |
+
box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
|
| 353 |
+
backdrop-filter: blur(5px);
|
| 354 |
}
|
| 355 |
.gr-padded {
|
| 356 |
padding: 20px;
|
| 357 |
}
|
| 358 |
.gr-form label, .gr-form .label-wrap {
|
| 359 |
+
color: #e6ccff !important;
|
| 360 |
+
font-weight: bold;
|
| 361 |
}
|
| 362 |
.gr-input, .gr-dropdown {
|
| 363 |
+
background-color: rgba(47, 1, 71, 0.8) !important;
|
| 364 |
+
border: 2px solid #8a2be2 !important;
|
| 365 |
+
color: #ffffff !important;
|
| 366 |
+
border-radius: 8px;
|
| 367 |
}
|
| 368 |
.gr-input::placeholder {
|
| 369 |
+
color: #b19cd9 !important;
|
| 370 |
}
|
| 371 |
.gr-checkbox {
|
| 372 |
+
background-color: #4b0082 !important;
|
| 373 |
+
border-color: #8a2be2 !important;
|
| 374 |
}
|
| 375 |
.gr-checkbox:checked {
|
| 376 |
+
background-color: #8a2be2 !important;
|
| 377 |
}
|
| 378 |
h1, h2, h3 {
|
| 379 |
+
color: #ffd700 !important;
|
| 380 |
+
text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
|
| 381 |
+
}
|
| 382 |
+
.gr-block {
|
| 383 |
+
border: none !important;
|
| 384 |
+
}
|
| 385 |
+
.gr-accordion {
|
| 386 |
+
border: 2px solid #8a2be2;
|
| 387 |
+
border-radius: 10px;
|
| 388 |
+
overflow: hidden;
|
| 389 |
+
}
|
| 390 |
+
.gr-accordion summary {
|
| 391 |
+
background-color: rgba(75, 0, 130, 0.9);
|
| 392 |
+
color: #ffd700;
|
| 393 |
+
padding: 10px;
|
| 394 |
+
font-weight: bold;
|
| 395 |
+
cursor: pointer;
|
| 396 |
}
|
| 397 |
"""
|
| 398 |
|
| 399 |
# Gradio interface
|
| 400 |
+
with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
| 401 |
+
gr.HTML(
|
| 402 |
+
"<h1 style='text-align: center; color: #FFD700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);'>JoyCaption Alpha One Mod</h1>"
|
| 403 |
+
"<p style='text-align: center; color: #e6ccff;'>Generate captivating captions for your images!</p>"
|
| 404 |
+
)
|
| 405 |
with gr.Row():
|
| 406 |
with gr.Column(scale=1):
|
| 407 |
with gr.Group():
|
|
|
|
| 424 |
value="any",
|
| 425 |
)
|
| 426 |
gr.Markdown("**Note:** Caption tone doesn't affect `rng-tags` and `training_prompt`.")
|
| 427 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 428 |
with gr.Row():
|
| 429 |
+
jc_text_model = gr.Dropdown(label="LLM Model", info="You can enter a Hugging Face model repo_id to use.",
|
| 430 |
choices=get_text_model(), value=get_text_model()[0],
|
| 431 |
allow_custom_value=True, interactive=True, min_width=320)
|
| 432 |
jc_gguf = gr.Dropdown(label=f"GGUF Filename", choices=[], value="",
|