Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=[
|