ginipick commited on
Commit
9a6cd26
ยท
verified ยท
1 Parent(s): d648867

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -24
app.py CHANGED
@@ -430,6 +430,9 @@ button.primary:hover {
430
  }
431
  """
432
 
 
 
 
433
  # UI ๊ตฌ์„ฑ
434
  with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
435
  gr.HTML("""
@@ -467,7 +470,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
467
  scale=1
468
  )
469
 
470
-
471
  with gr.Row(visible=False) as object_controls:
472
  with gr.Column(scale=1):
473
  with gr.Row():
@@ -492,7 +494,13 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
492
  label="Object Size (%)"
493
  )
494
 
495
- # ๊ฐ ๋ฒ„ํŠผ์— ๋Œ€ํ•œ ํด๋ฆญ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ
 
 
 
 
 
 
496
  def update_position(new_position):
497
  return new_position
498
 
@@ -505,18 +513,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
505
  btn_bottom_left.click(fn=lambda: update_position("bottom-left"), outputs=position)
506
  btn_bottom_center.click(fn=lambda: update_position("bottom-center"), outputs=position)
507
  btn_bottom_right.click(fn=lambda: update_position("bottom-right"), outputs=position)
508
-
509
-
510
 
511
- # ์œ„์น˜ ์„ ํƒ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ
512
- position_grid.click(
513
- fn=lambda evt: evt.index, # ํด๋ฆญ๋œ ์œ„์น˜์˜ ์ธ๋ฑ์Šค ๋ฐ˜ํ™˜
514
- inputs=[],
515
- outputs=[position],
516
- preprocess=False
517
- )
518
-
519
-
520
  with gr.Column(scale=1):
521
  with gr.Row():
522
  combined_image = gr.Image(
@@ -563,17 +560,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
563
  queue=False
564
  )
565
 
566
- # ์œ„์น˜ ์„ ํƒ ๋ฒ„ํŠผ ํด๋ฆญ ์ด๋ฒคํŠธ
567
- def update_position(evt: gr.SelectData) -> str:
568
- """์œ„์น˜ ์„ ํƒ ์—…๋ฐ์ดํŠธ"""
569
- return evt.value
570
-
571
- position.change(
572
- fn=lambda x: gr.update(value=x),
573
- inputs=position,
574
- outputs=position
575
- )
576
-
577
  process_btn.click(
578
  fn=process_prompt,
579
  inputs=[
 
430
  }
431
  """
432
 
433
+ # UI ๊ตฌ์„ฑ
434
+ # UI ๊ตฌ์„ฑ ๋ถ€๋ถ„์—์„œ process_btn์„ ์œ„๋กœ ์ด๋™ํ•˜๊ณ  position_grid.click ๋ถ€๋ถ„ ์ œ๊ฑฐ
435
+
436
  # UI ๊ตฌ์„ฑ
437
  with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
438
  gr.HTML("""
 
470
  scale=1
471
  )
472
 
 
473
  with gr.Row(visible=False) as object_controls:
474
  with gr.Column(scale=1):
475
  with gr.Row():
 
494
  label="Object Size (%)"
495
  )
496
 
497
+ process_btn = gr.Button(
498
+ "Process",
499
+ variant="primary",
500
+ interactive=False
501
+ )
502
+
503
+ # ๊ฐ ๋ฒ„ํŠผ์— ๋Œ€ํ•œ ํด๋ฆญ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ
504
  def update_position(new_position):
505
  return new_position
506
 
 
513
  btn_bottom_left.click(fn=lambda: update_position("bottom-left"), outputs=position)
514
  btn_bottom_center.click(fn=lambda: update_position("bottom-center"), outputs=position)
515
  btn_bottom_right.click(fn=lambda: update_position("bottom-right"), outputs=position)
 
 
516
 
 
 
 
 
 
 
 
 
 
517
  with gr.Column(scale=1):
518
  with gr.Row():
519
  combined_image = gr.Image(
 
560
  queue=False
561
  )
562
 
 
 
 
 
 
 
 
 
 
 
 
563
  process_btn.click(
564
  fn=process_prompt,
565
  inputs=[