aiqtech commited on
Commit
7b74dcb
ยท
verified ยท
1 Parent(s): cdd5381

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -14
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
  """ํ…์ŠคํŠธ ํŒŒ๋ผ๋ฏธํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ"""