Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -564,7 +564,6 @@ css = '''
|
|
| 564 |
#title{text-align: center}
|
| 565 |
#title h1{font-size: 3em; display:inline-flex; align-items:center}
|
| 566 |
#title img{width: 100px; margin-right: 0.25em}
|
| 567 |
-
#gallery .grid-wrap{height: 5vh}
|
| 568 |
#lora_list{background: var(--block-background-fill);padding: 0 1em .3em; font-size: 90%}
|
| 569 |
.custom_lora_card{margin-bottom: 1em}
|
| 570 |
.card_internal{display: flex;height: 100px;margin-top: .5em}
|
|
@@ -581,47 +580,76 @@ css = '''
|
|
| 581 |
#random_btn{font-size: 300%}
|
| 582 |
#component-11{align-self: stretch;}
|
| 583 |
|
|
|
|
| 584 |
#lora_gallery {
|
| 585 |
margin: 20px 0;
|
| 586 |
padding: 10px;
|
| 587 |
border: 1px solid #ddd;
|
| 588 |
-
border-radius:
|
| 589 |
-
background:
|
| 590 |
width: 100% !important;
|
| 591 |
height: 800px !important;
|
|
|
|
|
|
|
| 592 |
}
|
| 593 |
|
|
|
|
| 594 |
#gallery {
|
| 595 |
display: grid !important;
|
| 596 |
grid-template-columns: repeat(6, 1fr) !important;
|
| 597 |
-
gap:
|
| 598 |
-
padding:
|
| 599 |
width: 100% !important;
|
| 600 |
height: 100% !important;
|
| 601 |
overflow-y: auto !important;
|
| 602 |
}
|
| 603 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
|
|
|
|
| 605 |
.gallery-item img {
|
| 606 |
width: 100% !important;
|
| 607 |
height: 100% !important;
|
| 608 |
object-fit: cover !important;
|
| 609 |
-
border-radius:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 610 |
}
|
| 611 |
|
| 612 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
|
| 614 |
-
/* ๊ฐค๋ฌ๋ฆฌ ์ปจํ
์ด๋
|
| 615 |
.gradio-container {
|
| 616 |
width: 100% !important;
|
| 617 |
max-width: none !important;
|
| 618 |
}
|
| 619 |
|
| 620 |
-
/* ํ
|
| 621 |
.row {
|
| 622 |
width: 100% !important;
|
| 623 |
margin: 0 !important;
|
| 624 |
}
|
|
|
|
| 625 |
/* ์
์ฒด๊ฐ ์๋ ๋ฒํผ */
|
| 626 |
.button_total {
|
| 627 |
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
@@ -633,25 +661,6 @@ css = '''
|
|
| 633 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 634 |
}
|
| 635 |
|
| 636 |
-
/* ๊ฐค๋ฌ๋ฆฌ ์์ดํ
์
์ฒด๊ฐ */
|
| 637 |
-
.gallery-item {
|
| 638 |
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
| 639 |
-
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 640 |
-
border-radius: 12px;
|
| 641 |
-
overflow: hidden;
|
| 642 |
-
}
|
| 643 |
-
|
| 644 |
-
.gallery-item:hover {
|
| 645 |
-
transform: translateY(-5px) scale(1.02);
|
| 646 |
-
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 647 |
-
}
|
| 648 |
-
|
| 649 |
-
/* ์
์ฒด๊ฐ ์๋ ์ปจํ
์ด๋ */
|
| 650 |
-
#lora_gallery {
|
| 651 |
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 652 |
-
background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
|
| 653 |
-
}
|
| 654 |
-
|
| 655 |
/* ์
์ฒด๊ฐ ์๋ ์
๋ ฅ ํ๋ */
|
| 656 |
input, textarea {
|
| 657 |
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -665,12 +674,29 @@ input:focus, textarea:focus {
|
|
| 665 |
/* ์ปดํฌ๋ํธ๋ค์ border-radius ์ค์ */
|
| 666 |
.gradio-container .input,
|
| 667 |
.gradio-container .button,
|
| 668 |
-
.gradio-container .block
|
| 669 |
-
.gallery-item,
|
| 670 |
-
#lora_gallery {
|
| 671 |
border-radius: 12px;
|
| 672 |
}
|
| 673 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 674 |
#footer {visibility: hidden;}
|
| 675 |
'''
|
| 676 |
|
|
@@ -686,24 +712,31 @@ with gr.Blocks(theme=custom_theme, css=css, delete_cache=(60, 3600)) as app:
|
|
| 686 |
๊ฐค๋ฌ๋ฆฌ์์ ์ํ๋ ๋ชจ๋ธ์ ์ ํ(์ต๋ 3๊ฐ๊น์ง) < ํ๋กฌํํธ์ ํ๊ธ ๋๋ ์๋ฌธ์ผ๋ก ์ํ๋ ๋ด์ฉ์ ์
๋ ฅ < Generate ๋ฒํผ ์คํ
|
| 687 |
"""
|
| 688 |
)
|
| 689 |
-
|
| 690 |
-
# Row์์ theme ๋งค๊ฐ๋ณ์ ์ ๊ฑฐ
|
| 691 |
with gr.Row(elem_id="lora_gallery", equal_height=True):
|
| 692 |
gallery = gr.Gallery(
|
| 693 |
value=[(item["image"], item["title"]) for item in loras],
|
| 694 |
label="LoRA Explorer Gallery",
|
| 695 |
columns=6,
|
| 696 |
-
rows=
|
| 697 |
elem_id="gallery",
|
| 698 |
-
height=
|
| 699 |
object_fit="cover",
|
| 700 |
show_label=True,
|
| 701 |
allow_preview=False,
|
| 702 |
show_share_button=False,
|
| 703 |
-
container=True,
|
| 704 |
scale=1,
|
| 705 |
min_width=1200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 706 |
)
|
|
|
|
|
|
|
| 707 |
|
| 708 |
with gr.Tab(label="Generate"):
|
| 709 |
# Prompt and Generate Button
|
|
|
|
| 564 |
#title{text-align: center}
|
| 565 |
#title h1{font-size: 3em; display:inline-flex; align-items:center}
|
| 566 |
#title img{width: 100px; margin-right: 0.25em}
|
|
|
|
| 567 |
#lora_list{background: var(--block-background-fill);padding: 0 1em .3em; font-size: 90%}
|
| 568 |
.custom_lora_card{margin-bottom: 1em}
|
| 569 |
.card_internal{display: flex;height: 100px;margin-top: .5em}
|
|
|
|
| 580 |
#random_btn{font-size: 300%}
|
| 581 |
#component-11{align-self: stretch;}
|
| 582 |
|
| 583 |
+
/* ๊ฐค๋ฌ๋ฆฌ ๋ฉ์ธ ์ปจํ
์ด๋ */
|
| 584 |
#lora_gallery {
|
| 585 |
margin: 20px 0;
|
| 586 |
padding: 10px;
|
| 587 |
border: 1px solid #ddd;
|
| 588 |
+
border-radius: 12px;
|
| 589 |
+
background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
|
| 590 |
width: 100% !important;
|
| 591 |
height: 800px !important;
|
| 592 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 593 |
+
overflow: hidden;
|
| 594 |
}
|
| 595 |
|
| 596 |
+
/* ๊ฐค๋ฌ๋ฆฌ ๊ทธ๋ฆฌ๋ ์ปจํ
์ด๋ */
|
| 597 |
#gallery {
|
| 598 |
display: grid !important;
|
| 599 |
grid-template-columns: repeat(6, 1fr) !important;
|
| 600 |
+
gap: 15px !important;
|
| 601 |
+
padding: 15px !important;
|
| 602 |
width: 100% !important;
|
| 603 |
height: 100% !important;
|
| 604 |
overflow-y: auto !important;
|
| 605 |
}
|
| 606 |
|
| 607 |
+
/* ๊ฐค๋ฌ๋ฆฌ ์์ดํ
*/
|
| 608 |
+
.gallery-item {
|
| 609 |
+
position: relative !important;
|
| 610 |
+
width: 100% !important;
|
| 611 |
+
aspect-ratio: 1 !important;
|
| 612 |
+
margin: 0 !important;
|
| 613 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
| 614 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 615 |
+
border-radius: 12px;
|
| 616 |
+
overflow: hidden;
|
| 617 |
+
}
|
| 618 |
|
| 619 |
+
/* ๊ฐค๋ฌ๋ฆฌ ์ด๋ฏธ์ง */
|
| 620 |
.gallery-item img {
|
| 621 |
width: 100% !important;
|
| 622 |
height: 100% !important;
|
| 623 |
object-fit: cover !important;
|
| 624 |
+
border-radius: 12px !important;
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
/* ๊ฐค๋ฌ๋ฆฌ ์์ดํ
ํธ๋ฒ ํจ๊ณผ */
|
| 628 |
+
.gallery-item:hover {
|
| 629 |
+
transform: translateY(-5px) scale(1.02);
|
| 630 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 631 |
+
z-index: 1;
|
| 632 |
}
|
| 633 |
|
| 634 |
+
/* ๊ฐค๋ฌ๋ฆฌ ๊ทธ๋ฆฌ๋ ๋ํผ */
|
| 635 |
+
.grid-wrap {
|
| 636 |
+
width: 100% !important;
|
| 637 |
+
height: 100% !important;
|
| 638 |
+
overflow: visible !important;
|
| 639 |
+
}
|
| 640 |
|
| 641 |
+
/* ๊ฐค๋ฌ๋ฆฌ ์ปจํ
์ด๋ ๊ธฐ๋ณธ ์ค์ */
|
| 642 |
.gradio-container {
|
| 643 |
width: 100% !important;
|
| 644 |
max-width: none !important;
|
| 645 |
}
|
| 646 |
|
| 647 |
+
/* ํ ์ค์ */
|
| 648 |
.row {
|
| 649 |
width: 100% !important;
|
| 650 |
margin: 0 !important;
|
| 651 |
}
|
| 652 |
+
|
| 653 |
/* ์
์ฒด๊ฐ ์๋ ๋ฒํผ */
|
| 654 |
.button_total {
|
| 655 |
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
|
|
| 661 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 662 |
}
|
| 663 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 664 |
/* ์
์ฒด๊ฐ ์๋ ์
๋ ฅ ํ๋ */
|
| 665 |
input, textarea {
|
| 666 |
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
|
|
|
| 674 |
/* ์ปดํฌ๋ํธ๋ค์ border-radius ์ค์ */
|
| 675 |
.gradio-container .input,
|
| 676 |
.gradio-container .button,
|
| 677 |
+
.gradio-container .block {
|
|
|
|
|
|
|
| 678 |
border-radius: 12px;
|
| 679 |
}
|
| 680 |
|
| 681 |
+
/* ๊ฐค๋ฌ๋ฆฌ ์คํฌ๋กค๋ฐ ์คํ์ผ๋ง */
|
| 682 |
+
#gallery::-webkit-scrollbar {
|
| 683 |
+
width: 8px;
|
| 684 |
+
}
|
| 685 |
+
|
| 686 |
+
#gallery::-webkit-scrollbar-track {
|
| 687 |
+
background: #f1f1f1;
|
| 688 |
+
border-radius: 4px;
|
| 689 |
+
}
|
| 690 |
+
|
| 691 |
+
#gallery::-webkit-scrollbar-thumb {
|
| 692 |
+
background: #888;
|
| 693 |
+
border-radius: 4px;
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
#gallery::-webkit-scrollbar-thumb:hover {
|
| 697 |
+
background: #555;
|
| 698 |
+
}
|
| 699 |
+
|
| 700 |
#footer {visibility: hidden;}
|
| 701 |
'''
|
| 702 |
|
|
|
|
| 712 |
๊ฐค๋ฌ๋ฆฌ์์ ์ํ๋ ๋ชจ๋ธ์ ์ ํ(์ต๋ 3๊ฐ๊น์ง) < ํ๋กฌํํธ์ ํ๊ธ ๋๋ ์๋ฌธ์ผ๋ก ์ํ๋ ๋ด์ฉ์ ์
๋ ฅ < Generate ๋ฒํผ ์คํ
|
| 713 |
"""
|
| 714 |
)
|
| 715 |
+
# Gallery ์ปดํฌ๋ํธ ์์
|
|
|
|
| 716 |
with gr.Row(elem_id="lora_gallery", equal_height=True):
|
| 717 |
gallery = gr.Gallery(
|
| 718 |
value=[(item["image"], item["title"]) for item in loras],
|
| 719 |
label="LoRA Explorer Gallery",
|
| 720 |
columns=6,
|
| 721 |
+
rows="auto", # ์๋ ํ ์กฐ์
|
| 722 |
elem_id="gallery",
|
| 723 |
+
height="800px",
|
| 724 |
object_fit="cover",
|
| 725 |
show_label=True,
|
| 726 |
allow_preview=False,
|
| 727 |
show_share_button=False,
|
|
|
|
| 728 |
scale=1,
|
| 729 |
min_width=1200
|
| 730 |
+
).style(
|
| 731 |
+
grid_cols=6,
|
| 732 |
+
grid_rows="auto",
|
| 733 |
+
height="800px",
|
| 734 |
+
width="100%",
|
| 735 |
+
container=True,
|
| 736 |
+
full_width=True
|
| 737 |
)
|
| 738 |
+
|
| 739 |
+
|
| 740 |
|
| 741 |
with gr.Tab(label="Generate"):
|
| 742 |
# Prompt and Generate Button
|