Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -522,6 +522,44 @@ def update_history(new_image, history):
|
|
| 522 |
history.insert(0, new_image)
|
| 523 |
return history
|
| 524 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 525 |
css = '''
|
| 526 |
#gen_btn{height: 100%}
|
| 527 |
#title{text-align: center}
|
|
@@ -564,13 +602,6 @@ css = '''
|
|
| 564 |
overflow-y: auto !important;
|
| 565 |
}
|
| 566 |
|
| 567 |
-
.gallery-item {
|
| 568 |
-
width: 100% !important;
|
| 569 |
-
height: 200px !important;
|
| 570 |
-
margin: 0 !important;
|
| 571 |
-
padding: 5px !important;
|
| 572 |
-
box-sizing: border-box !important;
|
| 573 |
-
}
|
| 574 |
|
| 575 |
.gallery-item img {
|
| 576 |
width: 100% !important;
|
|
@@ -579,11 +610,7 @@ css = '''
|
|
| 579 |
border-radius: 4px !important;
|
| 580 |
}
|
| 581 |
|
| 582 |
-
.
|
| 583 |
-
transform: scale(1.05);
|
| 584 |
-
z-index: 1;
|
| 585 |
-
transition: transform 0.2s ease;
|
| 586 |
-
}
|
| 587 |
|
| 588 |
/* κ°€λ¬λ¦¬ 컨ν
μ΄λ κ°μ λλΉ μ€μ */
|
| 589 |
.gradio-container {
|
|
@@ -596,7 +623,45 @@ css = '''
|
|
| 596 |
width: 100% !important;
|
| 597 |
margin: 0 !important;
|
| 598 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 599 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
#footer {visibility: hidden;}
|
| 601 |
'''
|
| 602 |
|
|
@@ -614,7 +679,7 @@ with gr.Blocks(css=css, delete_cache=(60, 3600)) as app:
|
|
| 614 |
)
|
| 615 |
|
| 616 |
# Gallery μ»΄ν¬λνΈ μμ
|
| 617 |
-
with gr.Row(elem_id="lora_gallery", equal_height=True):
|
| 618 |
gallery = gr.Gallery(
|
| 619 |
value=[(item["image"], item["title"]) for item in loras],
|
| 620 |
label="LoRA Explorer Gallery",
|
|
|
|
| 522 |
history.insert(0, new_image)
|
| 523 |
return history
|
| 524 |
|
| 525 |
+
custom_theme = gr.themes.Base(
|
| 526 |
+
primary_hue="blue",
|
| 527 |
+
secondary_hue="purple",
|
| 528 |
+
neutral_hue="slate",
|
| 529 |
+
).set(
|
| 530 |
+
button_primary_background_fill="*primary_500",
|
| 531 |
+
button_primary_background_fill_dark="*primary_600",
|
| 532 |
+
button_primary_background_fill_hover="*primary_400",
|
| 533 |
+
button_primary_border_color="*primary_500",
|
| 534 |
+
button_primary_border_color_dark="*primary_600",
|
| 535 |
+
button_primary_text_color="white",
|
| 536 |
+
button_primary_text_color_dark="white",
|
| 537 |
+
button_secondary_background_fill="*neutral_100",
|
| 538 |
+
button_secondary_background_fill_dark="*neutral_700",
|
| 539 |
+
button_secondary_background_fill_hover="*neutral_50",
|
| 540 |
+
button_secondary_text_color="*neutral_800",
|
| 541 |
+
button_secondary_text_color_dark="white",
|
| 542 |
+
background_fill_primary="*neutral_50",
|
| 543 |
+
background_fill_primary_dark="*neutral_900",
|
| 544 |
+
block_background_fill="white",
|
| 545 |
+
block_background_fill_dark="*neutral_800",
|
| 546 |
+
block_label_background_fill="*primary_500",
|
| 547 |
+
block_label_background_fill_dark="*primary_600",
|
| 548 |
+
block_label_text_color="white",
|
| 549 |
+
block_label_text_color_dark="white",
|
| 550 |
+
block_title_text_color="*neutral_800",
|
| 551 |
+
block_title_text_color_dark="white",
|
| 552 |
+
input_background_fill="white",
|
| 553 |
+
input_background_fill_dark="*neutral_800",
|
| 554 |
+
input_border_color="*neutral_200",
|
| 555 |
+
input_border_color_dark="*neutral_700",
|
| 556 |
+
input_placeholder_color="*neutral_400",
|
| 557 |
+
input_placeholder_color_dark="*neutral_400",
|
| 558 |
+
shadow_spread="8px",
|
| 559 |
+
shadow_inset="0px 2px 4px 0px rgba(0,0,0,0.05)",
|
| 560 |
+
border_radius_large="12px",
|
| 561 |
+
)
|
| 562 |
+
|
| 563 |
css = '''
|
| 564 |
#gen_btn{height: 100%}
|
| 565 |
#title{text-align: center}
|
|
|
|
| 602 |
overflow-y: auto !important;
|
| 603 |
}
|
| 604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 605 |
|
| 606 |
.gallery-item img {
|
| 607 |
width: 100% !important;
|
|
|
|
| 610 |
border-radius: 4px !important;
|
| 611 |
}
|
| 612 |
|
| 613 |
+
.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
|
| 615 |
/* κ°€λ¬λ¦¬ 컨ν
μ΄λ κ°μ λλΉ μ€μ */
|
| 616 |
.gradio-container {
|
|
|
|
| 623 |
width: 100% !important;
|
| 624 |
margin: 0 !important;
|
| 625 |
}
|
| 626 |
+
/* μ
μ²΄κ° μλ λ²νΌ */
|
| 627 |
+
.button_total {
|
| 628 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 629 |
+
transition: all 0.3s ease;
|
| 630 |
+
}
|
| 631 |
+
|
| 632 |
+
.button_total:hover {
|
| 633 |
+
transform: translateY(-2px);
|
| 634 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
/* κ°€λ¬λ¦¬ μμ΄ν
μ
μ²΄κ° */
|
| 638 |
+
.gallery-item {
|
| 639 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
| 640 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 641 |
+
border-radius: 12px;
|
| 642 |
+
overflow: hidden;
|
| 643 |
+
}
|
| 644 |
+
|
| 645 |
+
.gallery-item:hover {
|
| 646 |
+
transform: translateY(-5px) scale(1.02);
|
| 647 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 648 |
+
}
|
| 649 |
|
| 650 |
+
/* μ
μ²΄κ° μλ 컨ν
μ΄λ */
|
| 651 |
+
#lora_gallery {
|
| 652 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 653 |
+
background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
|
| 654 |
+
}
|
| 655 |
+
|
| 656 |
+
/* μ
μ²΄κ° μλ μ
λ ₯ νλ */
|
| 657 |
+
input, textarea {
|
| 658 |
+
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
| 659 |
+
transition: all 0.3s ease;
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
input:focus, textarea:focus {
|
| 663 |
+
box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
|
| 664 |
+
}
|
| 665 |
#footer {visibility: hidden;}
|
| 666 |
'''
|
| 667 |
|
|
|
|
| 679 |
)
|
| 680 |
|
| 681 |
# Gallery μ»΄ν¬λνΈ μμ
|
| 682 |
+
with gr.Row(theme=custom_theme, elem_id="lora_gallery", equal_height=True):
|
| 683 |
gallery = gr.Gallery(
|
| 684 |
value=[(item["image"], item["title"]) for item in loras],
|
| 685 |
label="LoRA Explorer Gallery",
|