Update app.py
Browse files
app.py
CHANGED
@@ -460,7 +460,7 @@ def update_background_style_options(background_type):
|
|
460 |
else:
|
461 |
return gr.update(choices=["์ ํํ์ธ์"], value="์ ํํ์ธ์")
|
462 |
|
463 |
-
#
|
464 |
with gr.Blocks() as demo:
|
465 |
gr.HTML(
|
466 |
"""
|
@@ -487,11 +487,11 @@ with gr.Blocks() as demo:
|
|
487 |
)
|
488 |
|
489 |
with gr.Row():
|
490 |
-
image_change_btn = gr.Button("์ด๋ฏธ์ง ๋ณ๊ฒฝ")
|
491 |
-
text_remove_btn = gr.Button("๊ธ์์ง์ฐ๊ธฐ")
|
492 |
-
clothes_change_btn = gr.Button("์ท๋ฐ๊พธ๊ธฐ")
|
493 |
-
background_change_btn = gr.Button("๋ฐฐ๊ฒฝ๋ฐ๊พธ๊ธฐ", variant="
|
494 |
-
composite_product_btn = gr.Button("์ํํฉ์ฑ")
|
495 |
|
496 |
# ๋ฐฐ๊ฒฝ ๋ณ๊ฒฝ ๊ด๋ จ ์น์
(๊ธฐ๋ณธ์ ์ผ๋ก ์จ๊น ์ํ)
|
497 |
with gr.Row(visible=False) as background_header:
|
@@ -571,12 +571,11 @@ with gr.Blocks() as demo:
|
|
571 |
visible=False
|
572 |
)
|
573 |
|
574 |
-
#
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
submit_btn = gr.Button("์ด๋ฏธ์ง ์์ฑ", variant="primary")
|
580 |
|
581 |
with gr.Column(scale=1):
|
582 |
output_image = gr.Image(label="์์ฑ๋ ์ด๋ฏธ์ง")
|
@@ -591,14 +590,14 @@ with gr.Blocks() as demo:
|
|
591 |
gr.update(visible=True), gr.update(visible=True), gr.update(visible=True),
|
592 |
gr.update(visible=True), gr.update(visible=True), gr.update(visible=True),
|
593 |
gr.update(visible=True), gr.update(visible=True), gr.update(visible=True),
|
594 |
-
gr.update(visible=True), "", gr.update(visible=True)) # ๋ฒํผ
|
595 |
|
596 |
background_change_btn.click(
|
597 |
fn=show_background_options,
|
598 |
inputs=[],
|
599 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
600 |
background_type, background_style, additional_header, lighting, texture,
|
601 |
-
color_tone, mood, selection_preview,
|
602 |
)
|
603 |
|
604 |
# ๋ค๋ฅธ ๊ธฐ๋ฅ ๋ฒํผ๋ค๋ ๊ฐ๋จํ ๋ฐฉ์์ผ๋ก ์์
|
@@ -607,14 +606,14 @@ with gr.Blocks() as demo:
|
|
607 |
gr.update(visible=False), gr.update(visible=False), gr.update(visible=False),
|
608 |
gr.update(visible=False), gr.update(visible=False), gr.update(visible=False),
|
609 |
gr.update(visible=False), gr.update(visible=False), gr.update(visible=False),
|
610 |
-
gr.update(visible=False), "", gr.update(visible=False)) # ๋ฒํผ
|
611 |
|
612 |
image_change_btn.click(
|
613 |
fn=lambda: hide_background_options("#1 ์ด๋ฏธ์ง์ [๋ค๋ฅธ ๋ชจ์ต]์ผ๋ก ๋ณ๊ฒฝํ๋ผ."),
|
614 |
inputs=[],
|
615 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
616 |
background_type, background_style, additional_header, lighting, texture,
|
617 |
-
color_tone, mood, selection_preview,
|
618 |
)
|
619 |
|
620 |
text_remove_btn.click(
|
@@ -622,7 +621,7 @@ with gr.Blocks() as demo:
|
|
622 |
inputs=[],
|
623 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
624 |
background_type, background_style, additional_header, lighting, texture,
|
625 |
-
color_tone, mood, selection_preview,
|
626 |
)
|
627 |
|
628 |
clothes_change_btn.click(
|
@@ -630,7 +629,7 @@ with gr.Blocks() as demo:
|
|
630 |
inputs=[],
|
631 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
632 |
background_type, background_style, additional_header, lighting, texture,
|
633 |
-
color_tone, mood, selection_preview,
|
634 |
)
|
635 |
|
636 |
composite_product_btn.click(
|
@@ -638,7 +637,7 @@ with gr.Blocks() as demo:
|
|
638 |
inputs=[],
|
639 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
640 |
background_type, background_style, additional_header, lighting, texture,
|
641 |
-
color_tone, mood, selection_preview,
|
642 |
)
|
643 |
|
644 |
# ์ ํ ์ต์
๋ณ๊ฒฝ ์ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์ LLM ํ๋กฌํํธ ์
๋ฐ์ดํธ
|
@@ -746,7 +745,4 @@ with gr.Blocks() as demo:
|
|
746 |
|
747 |
> **ํ**: ์ ํ ๋ด์ฉ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์์ ์์ฑ๋ ํ๋กฌํํธ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
|
748 |
"""
|
749 |
-
)
|
750 |
-
|
751 |
-
if __name__ == "__main__":
|
752 |
-
demo.launch(share=True)
|
|
|
460 |
else:
|
461 |
return gr.update(choices=["์ ํํ์ธ์"], value="์ ํํ์ธ์")
|
462 |
|
463 |
+
# ์ธํฐํ์ด์ค ๋ถ๋ถ ์์
|
464 |
with gr.Blocks() as demo:
|
465 |
gr.HTML(
|
466 |
"""
|
|
|
487 |
)
|
488 |
|
489 |
with gr.Row():
|
490 |
+
image_change_btn = gr.Button("์ด๋ฏธ์ง ๋ณ๊ฒฝ", variant="secondary")
|
491 |
+
text_remove_btn = gr.Button("๊ธ์์ง์ฐ๊ธฐ", variant="secondary")
|
492 |
+
clothes_change_btn = gr.Button("์ท๋ฐ๊พธ๊ธฐ", variant="secondary")
|
493 |
+
background_change_btn = gr.Button("๋ฐฐ๊ฒฝ๋ฐ๊พธ๊ธฐ", variant="secondary")
|
494 |
+
composite_product_btn = gr.Button("์ํํฉ์ฑ", variant="secondary")
|
495 |
|
496 |
# ๋ฐฐ๊ฒฝ ๋ณ๊ฒฝ ๊ด๋ จ ์น์
(๊ธฐ๋ณธ์ ์ผ๋ก ์จ๊น ์ํ)
|
497 |
with gr.Row(visible=False) as background_header:
|
|
|
571 |
visible=False
|
572 |
)
|
573 |
|
574 |
+
# ํ๋กฌํํธ ์์ฑ ๋ฒํผ (๋ฐฐ๊ฒฝ๋ฐ๊พธ๊ธฐ ์ ํ์์๋ง ๋ํ๋จ)
|
575 |
+
prompt_generate_btn = gr.Button("ํ๋กฌํํธ ์์ฑ", variant="secondary", visible=False)
|
576 |
+
|
577 |
+
# ์ด๋ฏธ์ง ์์ฑ ๋ฒํผ (ํญ์ ํ์)
|
578 |
+
submit_btn = gr.Button("์ด๋ฏธ์ง ์์ฑ", variant="primary")
|
|
|
579 |
|
580 |
with gr.Column(scale=1):
|
581 |
output_image = gr.Image(label="์์ฑ๋ ์ด๋ฏธ์ง")
|
|
|
590 |
gr.update(visible=True), gr.update(visible=True), gr.update(visible=True),
|
591 |
gr.update(visible=True), gr.update(visible=True), gr.update(visible=True),
|
592 |
gr.update(visible=True), gr.update(visible=True), gr.update(visible=True),
|
593 |
+
gr.update(visible=True), "", gr.update(visible=True)) # ํ๋กฌํํธ ์์ฑ ๋ฒํผ ํ์
|
594 |
|
595 |
background_change_btn.click(
|
596 |
fn=show_background_options,
|
597 |
inputs=[],
|
598 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
599 |
background_type, background_style, additional_header, lighting, texture,
|
600 |
+
color_tone, mood, selection_preview, prompt_generate_btn]
|
601 |
)
|
602 |
|
603 |
# ๋ค๋ฅธ ๊ธฐ๋ฅ ๋ฒํผ๋ค๋ ๊ฐ๋จํ ๋ฐฉ์์ผ๋ก ์์
|
|
|
606 |
gr.update(visible=False), gr.update(visible=False), gr.update(visible=False),
|
607 |
gr.update(visible=False), gr.update(visible=False), gr.update(visible=False),
|
608 |
gr.update(visible=False), gr.update(visible=False), gr.update(visible=False),
|
609 |
+
gr.update(visible=False), "", gr.update(visible=False)) # ํ๋กฌํํธ ์์ฑ ๋ฒํผ ์จ๊น
|
610 |
|
611 |
image_change_btn.click(
|
612 |
fn=lambda: hide_background_options("#1 ์ด๋ฏธ์ง์ [๋ค๋ฅธ ๋ชจ์ต]์ผ๋ก ๋ณ๊ฒฝํ๋ผ."),
|
613 |
inputs=[],
|
614 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
615 |
background_type, background_style, additional_header, lighting, texture,
|
616 |
+
color_tone, mood, selection_preview, prompt_generate_btn]
|
617 |
)
|
618 |
|
619 |
text_remove_btn.click(
|
|
|
621 |
inputs=[],
|
622 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
623 |
background_type, background_style, additional_header, lighting, texture,
|
624 |
+
color_tone, mood, selection_preview, prompt_generate_btn]
|
625 |
)
|
626 |
|
627 |
clothes_change_btn.click(
|
|
|
629 |
inputs=[],
|
630 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
631 |
background_type, background_style, additional_header, lighting, texture,
|
632 |
+
color_tone, mood, selection_preview, prompt_generate_btn]
|
633 |
)
|
634 |
|
635 |
composite_product_btn.click(
|
|
|
637 |
inputs=[],
|
638 |
outputs=[prompt_input, current_selection, background_header, product_name, product_category,
|
639 |
background_type, background_style, additional_header, lighting, texture,
|
640 |
+
color_tone, mood, selection_preview, prompt_generate_btn]
|
641 |
)
|
642 |
|
643 |
# ์ ํ ์ต์
๋ณ๊ฒฝ ์ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์ LLM ํ๋กฌํํธ ์
๋ฐ์ดํธ
|
|
|
745 |
|
746 |
> **ํ**: ์ ํ ๋ด์ฉ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์์ ์์ฑ๋ ํ๋กฌํํธ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
|
747 |
"""
|
748 |
+
)
|
|
|
|
|
|