Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -543,6 +543,22 @@ def add_text_to_image(image, text_params):
|
|
543 |
)
|
544 |
|
545 |
return Image.alpha_composite(image, txt_overlay)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
|
547 |
# UI ๊ตฌ์ฑ
|
548 |
with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
@@ -685,21 +701,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
685 |
)
|
686 |
|
687 |
|
688 |
-
# UI ๊ตฌ์ฑ ๋ถ๋ถ์์ ์ด๋ฒคํธ ํธ๋ค๋ฌ ํจ์๋ค์ ๋จผ์ ์ ์
|
689 |
-
def update_controls(bg_prompt):
|
690 |
-
"""๋ฐฐ๊ฒฝ ํ๋กฌํํธ ์
๋ ฅ ์ฌ๋ถ์ ๋ฐ๋ผ ์ปจํธ๋กค ํ์ ์
๋ฐ์ดํธ"""
|
691 |
-
is_visible = bool(bg_prompt)
|
692 |
-
return [
|
693 |
-
gr.update(visible=True), # aspect_ratio๋ ํญ์ ํ์
|
694 |
-
gr.update(visible=is_visible) # object_controls
|
695 |
-
]
|
696 |
|
697 |
-
def update_process_button(img, prompt):
|
698 |
-
"""ํ๋ก์ธ์ค ๋ฒํผ ์ํ ์
๋ฐ์ดํธ"""
|
699 |
-
return gr.update(
|
700 |
-
interactive=bool(img and prompt),
|
701 |
-
variant="primary" if bool(img and prompt) else "secondary"
|
702 |
-
)
|
703 |
|
704 |
def get_text_params():
|
705 |
"""ํ
์คํธ ํ๋ผ๋ฏธํฐ ๊ฐ์ ธ์ค๊ธฐ"""
|
|
|
543 |
)
|
544 |
|
545 |
return Image.alpha_composite(image, txt_overlay)
|
546 |
+
|
547 |
+
|
548 |
+
def update_controls(bg_prompt):
|
549 |
+
"""๋ฐฐ๊ฒฝ ํ๋กฌํํธ ์
๋ ฅ ์ฌ๋ถ์ ๋ฐ๋ผ ์ปจํธ๋กค ํ์ ์
๋ฐ์ดํธ"""
|
550 |
+
is_visible = bool(bg_prompt)
|
551 |
+
return [
|
552 |
+
gr.update(visible=True), # aspect_ratio๋ ํญ์ ํ์
|
553 |
+
gr.update(visible=is_visible) # object_controls
|
554 |
+
]
|
555 |
+
|
556 |
+
def update_process_button(img, prompt):
|
557 |
+
"""ํ๋ก์ธ์ค ๋ฒํผ ์ํ ์
๋ฐ์ดํธ"""
|
558 |
+
return gr.update(
|
559 |
+
interactive=bool(img and prompt),
|
560 |
+
variant="primary" if bool(img and prompt) else "secondary"
|
561 |
+
)
|
562 |
|
563 |
# UI ๊ตฌ์ฑ
|
564 |
with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
|
701 |
)
|
702 |
|
703 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
|
706 |
def get_text_params():
|
707 |
"""ํ
์คํธ ํ๋ผ๋ฏธํฐ ๊ฐ์ ธ์ค๊ธฐ"""
|