Update app.py
Browse files
app.py
CHANGED
@@ -770,25 +770,129 @@ with gr.Blocks(css=custom_css) as demo:
|
|
770 |
with gr.Tabs(elem_classes="custom-tabs") as tabs:
|
771 |
# ์ฌ์ฉ ์ค๋ช
์ ํญ์ ์ฒซ ๋ฒ์งธ๋ก ๋ฐฐ์น
|
772 |
with gr.TabItem("๐ ์ฌ์ฉ ์ค๋ช
์", elem_classes="tab-content"):
|
773 |
-
gr.HTML(user_manual_html)
|
774 |
-
|
775 |
-
# ์ถ๊ฐ์ ์ธ ์ฌ์ฉ ์ค๋ช
๋ด์ฉ์ด ํ์ํ๋ค๋ฉด ์ฌ๊ธฐ์ ์์ฑํ ์ ์์ต๋๋ค
|
776 |
gr.HTML("""
|
777 |
-
<div class="manual
|
778 |
-
<div class="manual-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
789 |
</div>
|
790 |
""")
|
791 |
-
|
792 |
with gr.TabItem("โจ ์ด์ปค๋จธ์ค ์ด๋ฏธ์ง ์์ฑ๊ธฐ", elem_classes="tab-content"):
|
793 |
with gr.Row(equal_height=True):
|
794 |
with gr.Column(scale=1):
|
@@ -819,7 +923,9 @@ with gr.Blocks(css=custom_css) as demo:
|
|
819 |
background_change_btn = gr.Button('๐ผ๏ธ ๋ฐฐ๊ฒฝ ๋ฐ๊พธ๊ธฐ', elem_classes="custom-button")
|
820 |
composite_product_btn = gr.Button('โ๏ธ ๋ถ๋ถ ์ง์ฐ๊ธฐ', elem_classes="custom-button")
|
821 |
|
822 |
-
|
|
|
|
|
823 |
|
824 |
with gr.Column(scale=1):
|
825 |
with gr.Group(elem_classes="panel"):
|
@@ -952,6 +1058,15 @@ with gr.Blocks(css=custom_css) as demo:
|
|
952 |
inputs=[],
|
953 |
outputs=prompt_input
|
954 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
955 |
submit_btn.click(
|
956 |
fn=generate_multiple_images,
|
957 |
inputs=[image1_input, image2_input, image3_input, prompt_input],
|
|
|
770 |
with gr.Tabs(elem_classes="custom-tabs") as tabs:
|
771 |
# ์ฌ์ฉ ์ค๋ช
์ ํญ์ ์ฒซ ๋ฒ์งธ๋ก ๋ฐฐ์น
|
772 |
with gr.TabItem("๐ ์ฌ์ฉ ์ค๋ช
์", elem_classes="tab-content"):
|
|
|
|
|
|
|
773 |
gr.HTML("""
|
774 |
+
<div class="user-manual">
|
775 |
+
<div class="manual-title"><i class="fas fa-book"></i> ์ฌ์ฉ ์ค๋ช
์</div>
|
776 |
+
|
777 |
+
<div class="manual-section">
|
778 |
+
<div class="manual-section-title"><i class="fas fa-magic"></i> ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ</div>
|
779 |
+
<p class="manual-text">
|
780 |
+
<span style="font-size: 1.1rem; font-weight: 600; color: #5561e9;">1๏ธโฃ ์ด๋ฏธ์ง ์
๋ก๋</span><br>
|
781 |
+
์ต๋ 3๊ฐ์ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ ์ ์์ต๋๋ค. ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง๋ ํ์์
๋๋ค.<br><br>
|
782 |
+
|
783 |
+
<span style="font-size: 1.1rem; font-weight: 600; color: #5561e9;">2๏ธโฃ ํ๋กฌํํธ ์
๋ ฅ ๋๋ ๋ฒํผ ์ ํ</span><br>
|
784 |
+
๋ณํํ๊ณ ์ถ์ ๋ด์ฉ์ ์ง์ ์
๋ ฅํ๊ฑฐ๋, ๋ฏธ๋ฆฌ ์ ์๋ ๋ฒํผ ์ค ํ๋๋ฅผ ์ ํํ์ธ์.<br><br>
|
785 |
+
|
786 |
+
<span style="font-size: 1.1rem; font-weight: 600; color: #5561e9;">3๏ธโฃ ์ด๋ฏธ์ง ์์ฑ</span><br>
|
787 |
+
'์ด๋ฏธ์ง ์์ฑ (1์ฅ)' ๋ฒํผ์ ํด๋ฆญํ๋ฉด 1๊ฐ์ ์ด๋ฏธ์ง๊ฐ, '์ด๋ฏธ์ง ์์ฑ (4์ฅ)' ๋ฒํผ์ ํด๋ฆญํ๋ฉด 4๊ฐ์ง ๋ฒ์ ์ ์ด๋ฏธ์ง๊ฐ ์์ฑ๋ฉ๋๋ค.
|
788 |
+
</p>
|
789 |
+
</div>
|
790 |
+
|
791 |
+
<div class="manual-section">
|
792 |
+
<div class="manual-section-title"><i class="fas fa-hashtag"></i> ์ด๋ฏธ์ง ์ฐธ์กฐ ๋ฐฉ๋ฒ</div>
|
793 |
+
<p class="manual-text">
|
794 |
+
ํ๋กฌํํธ์์ ๋ค์ ํ๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ ์ด๋ฏธ์ง๋ฅผ ์ฐธ์กฐํ ์ ์์ต๋๋ค:
|
795 |
+
<ul>
|
796 |
+
<li><strong style="font-size: 1.05rem;">#1</strong> - ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง</li>
|
797 |
+
<li><strong style="font-size: 1.05rem;">#2</strong> - ๋ ๋ฒ์งธ ์ด๋ฏธ์ง</li>
|
798 |
+
<li><strong style="font-size: 1.05rem;">#3</strong> - ์ธ ๋ฒ์งธ ์ด๋ฏธ์ง</li>
|
799 |
+
</ul>
|
800 |
+
|
801 |
+
<div class="tip-box">
|
802 |
+
<i class="fas fa-lightbulb"></i> <strong>ํ:</strong> ์๋ฅผ ๋ค์ด, "(#1์ ์ฌ์ฑ๋ชจ๋ธ)์ด (#2์ ์ ๊ธ๋ผ์ค)๋ฅผ ์ฐฉ์ฉํ ๋ชจ์ต"๊ณผ ๊ฐ์ด ์ฌ์ฉํ ์ ์์ต๋๋ค.
|
803 |
+
</div>
|
804 |
+
</p>
|
805 |
+
</div>
|
806 |
+
|
807 |
+
<div class="manual-section">
|
808 |
+
<div class="manual-section-title"><i class="fas fa-tools"></i> ์ฃผ์ ๊ธฐ๋ฅ</div>
|
809 |
+
<div class="manual-text">
|
810 |
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem;">
|
811 |
+
<div>
|
812 |
+
<p style="font-size: 1.1rem; font-weight: 600; color: #ff6b6b;"><i class="fas fa-exchange-alt"></i> ์ด๋ฏธ์ง ๋ณ๊ฒฝ</p>
|
813 |
+
ํฌ์ฆ๋ ์คํ์ผ์ ๋ณ๊ฒฝํ๋ฉด์ ์๋ณธ์ ์ฃผ์ ์์๋ ์ ์งํฉ๋๋ค.
|
814 |
+
</div>
|
815 |
+
|
816 |
+
<div>
|
817 |
+
<p style="font-size: 1.1rem; font-weight: 600; color: #ff6b6b;"><i class="fas fa-eraser"></i> ๊ธ์ ์ง์ฐ๊ธฐ/๋ณ๊ฒฝ</p>
|
818 |
+
์ด๋ฏธ์ง์ ํ
์คํธ๋ฅผ ์์ฐ์ค๋ฝ๊ฒ ์ ๊ฑฐํ๊ฑฐ๋ ๋ค๋ฅธ ํ
์คํธ๋ก ๋ณ๊ฒฝํฉ๋๋ค.
|
819 |
+
</div>
|
820 |
+
|
821 |
+
<div>
|
822 |
+
<p style="font-size: 1.1rem; font-weight: 600; color: #ff6b6b;"><i class="fas fa-tshirt"></i> ๊ฐ์ ์ํ์ฐฉ์ฉ</p>
|
823 |
+
๋ชจ๋ธ์๊ฒ ๋ค๋ฅธ ์ด๋ฏธ์ง์ ์ํ์ ์์ฐ์ค๋ฝ๊ฒ ์ฐฉ์ฉ์ํต๋๋ค.
|
824 |
+
</div>
|
825 |
+
|
826 |
+
<div>
|
827 |
+
<p style="font-size: 1.1rem; font-weight: 600; color: #ff6b6b;"><i class="fas fa-image"></i> ๋ฐฐ๊ฒฝ ๋ฐ๊พธ๊ธฐ</p>
|
828 |
+
์ฃผ์ ํผ์ฌ์ฒด๋ ์ ์งํ๋ฉฐ ๋ฐฐ๊ฒฝ๋ง ๊ต์ฒดํฉ๋๋ค.
|
829 |
+
</div>
|
830 |
+
|
831 |
+
<div>
|
832 |
+
<p style="font-size: 1.1rem; font-weight: 600; color: #ff6b6b;"><i class="fas fa-cut"></i> ๋ถ๋ถ ์ง์ฐ๊ธฐ</p>
|
833 |
+
์ด๋ฏธ์ง์ ํน์ ๋ถ๋ถ์ ์ง์ฐ๊ณ ๋ฐฐ๊ฒฝ๊ณผ ์์ฐ์ค๋ฝ๊ฒ ์กฐํ๋๋๋ก ์ฑ์๋๋ค.
|
834 |
+
</div>
|
835 |
+
|
836 |
+
<div>
|
837 |
+
<p style="font-size: 1.1rem; font-weight: 600; color: #ff6b6b;"><i class="fas fa-wine-glass"></i> ์ํ๋ค๊ณ ์๊ธฐ</p>
|
838 |
+
๋ชจ๋ธ์ด ์ํ์ ๋ค๊ณ ์๋ ์์ฐ์ค๋ฌ์ด ํฌ์ฆ์ ์ด๋ฏธ์ง๋ฅผ ์์ฑํฉ๋๋ค.
|
839 |
+
</div>
|
840 |
+
</div>
|
841 |
+
</div>
|
842 |
+
</div>
|
843 |
+
|
844 |
+
<div class="manual-section">
|
845 |
+
<div class="manual-section-title"><i class="fas fa-search-plus"></i> GFPGAN ์
์ค์ผ์ผ๋ฌ</div>
|
846 |
+
<p class="manual-text">
|
847 |
+
<span style="font-size: 1.1rem; font-weight: 600; color: #5561e9;">์ด๋ฏธ์ง ๊ฐ์ ๊ธฐ๋ฅ</span><br>
|
848 |
+
์ ํด์๋ ์ด๋ฏธ์ง๋ฅผ ๊ณ ํด์๋๋ก ๋ณํํ๊ณ , ์ผ๊ตด์ ์์ฐ์ค๋ฝ๊ฒ ๋ณต์ํฉ๋๋ค.<br>
|
849 |
+
ํนํ ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ์ ํจ๊ณผ์ ์
๋๋ค:
|
850 |
+
<ul>
|
851 |
+
<li>ํด์๋๊ฐ ๋ฎ์ ์ด๋ฏธ์ง ๊ฐ์ </li>
|
852 |
+
<li>ํ๋ฆฟํ๊ฑฐ๋ ๋
ธ์ด์ฆ๊ฐ ์๋ ์ผ๊ตด ๋ณต์</li>
|
853 |
+
<li>์ด๋ฏธ์ง ์ ๋ฐ์ ์ธ ์ ๋ช
๋ ํฅ์</li>
|
854 |
+
</ul>
|
855 |
+
|
856 |
+
<div class="tip-box">
|
857 |
+
<i class="fas fa-lightbulb"></i> <strong>ํ:</strong> ์ด๋ฏธ์ง์ ํฌ๊ธฐ๊ฐ ์์์๋ก ์ฒ๋ฆฌ ์๋๊ฐ ๋น ๋ฆ
๋๋ค. ์ผ๊ตด์ด ํฌํจ๋ ์ด๋ฏธ์ง์์ ๊ฐ์ฅ ์ข์ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์์ต๋๋ค.
|
858 |
+
</div>
|
859 |
+
</p>
|
860 |
+
</div>
|
861 |
+
|
862 |
+
<div class="manual-section">
|
863 |
+
<div class="manual-section-title"><i class="fas fa-cut"></i> ๋ฐฐ๊ฒฝ ์ง์ฐ๊ธฐ ๊ธฐ๋ฅ</div>
|
864 |
+
<p class="manual-text">
|
865 |
+
<span style="font-size: 1.1rem; font-weight: 600; color: #5561e9;">์๋ ๋ฐฐ๊ฒฝ ์ ๊ฑฐ</span><br>
|
866 |
+
์ด๋ฏธ์ง์์ ๋ฐฐ๊ฒฝ์ ์๋์ผ๋ก ๊ฐ์งํ๊ณ ์ ๊ฑฐํ์ฌ ํฌ๋ช
ํ PNG ์ด๋ฏธ์ง๋ก ๋ณํํฉ๋๋ค.<br>
|
867 |
+
์ฃผ์ ์ฌ์ฉ ์ฌ๋ก:
|
868 |
+
<ul>
|
869 |
+
<li>์ ํ ์ด๋ฏธ์ง์ ๋ฐฐ๊ฒฝ ์ ๊ฑฐ</li>
|
870 |
+
<li>์ธ๋ฌผ ์ฌ์ง์์ ๋ฐฐ๊ฒฝ ๋ถ๋ฆฌ</li>
|
871 |
+
<li>์ฌ๋ฌ ์ด๋ฏธ์ง ํฉ์ฑ์ ์ํ ์ค๋น</li>
|
872 |
+
</ul>
|
873 |
+
|
874 |
+
<div class="tip-box">
|
875 |
+
<i class="fas fa-lightbulb"></i> <strong>ํ:</strong> ๋ฐฐ๊ฒฝ๊ณผ ์ฃผ์ ํผ์ฌ์ฒด ๊ฐ์ ๋๋น๊ฐ ๋๋ ทํ ์๋ก ๋ ์ ํํ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์์ต๋๋ค. ๋ณต์กํ ๋ฐฐ๊ฒฝ์ ๊ฒฝ์ฐ ๋ฏธ์ธ ์กฐ์ ์ด ํ์ํ ์ ์์ต๋๋ค.
|
876 |
+
</div>
|
877 |
+
</p>
|
878 |
+
</div>
|
879 |
+
|
880 |
+
<div class="manual-section">
|
881 |
+
<div class="manual-section-title"><i class="fas fa-question-circle"></i> ์์ฃผ ๋ฌป๋ ์ง๋ฌธ</div>
|
882 |
+
<p class="manual-text">
|
883 |
+
<strong style="font-size: 1.1rem; color: #5561e9;">Q: ์ด๋ค ํ์์ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ ์ ์๋์?</strong><br>
|
884 |
+
A: JPG, PNG, WEBP ๋ฑ ๋๋ถ๋ถ์ ์ผ๋ฐ์ ์ธ ์ด๋ฏธ์ง ํ์์ ์ง์ํฉ๋๋ค.<br><br>
|
885 |
+
|
886 |
+
<strong style="font-size: 1.1rem; color: #5561e9;">Q: ์ด๋ฏธ์ง ์์ฑ ๋ฐ ์ฒ๋ฆฌ์ ์ผ๋ง๋ ์๊ฐ์ด ๊ฑธ๋ฆฌ๋์?</strong><br>
|
887 |
+
A: ์ผ๋ฐ์ ์ผ๋ก 10-30์ด ์ ๋ ์์๋๋ฉฐ, ์ด๋ฏธ์ง ํฌ๊ธฐ์ ๋ณต์ก๋์ ๋ฐ๋ผ ๋ฌ๋ผ์ง ์ ์์ต๋๋ค.<br><br>
|
888 |
+
|
889 |
+
<strong style="font-size: 1.1rem; color: #5561e9;">Q: ์์ฑ๋ ์ด๋ฏธ์ง๋ฅผ ์ด๋ป๊ฒ ์ ์ฅํ ์ ์๋์?</strong><br>
|
890 |
+
A: ์์ฑ๋ ์ด๋ฏธ์ง์ ๋ง์ฐ์ค ์ค๋ฅธ์ชฝ ๋ฒํผ์ ํด๋ฆญํ์ฌ '์ด๋ฏธ์ง ์ ์ฅ' ์ต์
์ ์ ํํ๋ฉด ๋ฉ๋๋ค.
|
891 |
+
</p>
|
892 |
+
</div>
|
893 |
</div>
|
894 |
""")
|
895 |
+
|
896 |
with gr.TabItem("โจ ์ด์ปค๋จธ์ค ์ด๋ฏธ์ง ์์ฑ๊ธฐ", elem_classes="tab-content"):
|
897 |
with gr.Row(equal_height=True):
|
898 |
with gr.Column(scale=1):
|
|
|
923 |
background_change_btn = gr.Button('๐ผ๏ธ ๋ฐฐ๊ฒฝ ๋ฐ๊พธ๊ธฐ', elem_classes="custom-button")
|
924 |
composite_product_btn = gr.Button('โ๏ธ ๋ถ๋ถ ์ง์ฐ๊ธฐ', elem_classes="custom-button")
|
925 |
|
926 |
+
with gr.Row():
|
927 |
+
submit_single_btn = gr.Button('โจ ์ด๋ฏธ์ง ์์ฑ (1์ฅ)', elem_classes="custom-button primary")
|
928 |
+
submit_btn = gr.Button('โจ ์ด๋ฏธ์ง ์์ฑ (4์ฅ)', elem_classes="custom-button primary")
|
929 |
|
930 |
with gr.Column(scale=1):
|
931 |
with gr.Group(elem_classes="panel"):
|
|
|
1058 |
inputs=[],
|
1059 |
outputs=prompt_input
|
1060 |
)
|
1061 |
+
|
1062 |
+
# ๋จ์ผ ์ด๋ฏธ์ง ์์ฑ ๋ฒํผ ์ด๋ฒคํธ ์ฐ๊ฒฐ
|
1063 |
+
submit_single_btn.click(
|
1064 |
+
fn=lambda image1, image2, image3, prompt: process_images_with_prompt(image1, image2, image3, prompt, 0),
|
1065 |
+
inputs=[image1_input, image2_input, image3_input, prompt_input],
|
1066 |
+
outputs=[output_image1, output_text, prompt_display],
|
1067 |
+
)
|
1068 |
+
|
1069 |
+
# 4์ฅ ์ด๋ฏธ์ง ์์ฑ ๋ฒํผ ์ด๋ฒคํธ ์ฐ๊ฒฐ
|
1070 |
submit_btn.click(
|
1071 |
fn=generate_multiple_images,
|
1072 |
inputs=[image1_input, image2_input, image3_input, prompt_input],
|