Commit
·
e74fb8a
1
Parent(s):
ff0d0ab
28. Sept. 2024, 16:39
Browse files
app.py
CHANGED
@@ -288,7 +288,7 @@ with gr.Blocks(theme=theme, css=custom_css, js=custom_js, head=custom_head, titl
|
|
288 |
if tab_name == "Lineart":
|
289 |
input_options = [preprocessor_name, invert]
|
290 |
return {"preprocessor_name": preprocessor_name, "invert": invert, "resolution": resolution}
|
291 |
-
|
292 |
## TAB Canny
|
293 |
with gr.Tab("Canny Edge") as tab_canny:
|
294 |
with gr.Row():
|
@@ -298,8 +298,15 @@ with gr.Blocks(theme=theme, css=custom_css, js=custom_js, head=custom_head, titl
|
|
298 |
low_threshold = gr.Slider(label="low_threshold", minimum=1, maximum=255, value=100, step=1)
|
299 |
high_threshold = gr.Slider(label="high_threshold", minimum=1, maximum=255, value=200, step=1)
|
300 |
resolution = gr.Slider(label="resolution", minimum=256, maximum=1024, value=512, step=64)
|
301 |
-
run_btn_canny = gr.Button("Run")
|
302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
with gr.Column(scale=2):
|
304 |
gallery = gr.Gallery(label="Generated images", show_label=False, interactive=False, format="png", elem_id="output_gallery", elem_classes="output-gallery", columns=[3], rows=[2], object_fit="contain", height="auto", type="filepath")
|
305 |
|
|
|
288 |
if tab_name == "Lineart":
|
289 |
input_options = [preprocessor_name, invert]
|
290 |
return {"preprocessor_name": preprocessor_name, "invert": invert, "resolution": resolution}
|
291 |
+
|
292 |
## TAB Canny
|
293 |
with gr.Tab("Canny Edge") as tab_canny:
|
294 |
with gr.Row():
|
|
|
298 |
low_threshold = gr.Slider(label="low_threshold", minimum=1, maximum=255, value=100, step=1)
|
299 |
high_threshold = gr.Slider(label="high_threshold", minimum=1, maximum=255, value=200, step=1)
|
300 |
resolution = gr.Slider(label="resolution", minimum=256, maximum=1024, value=512, step=64)
|
|
|
301 |
|
302 |
+
|
303 |
+
run_btn_lineart = gr.Button("Run", visible=False)
|
304 |
+
run_btn_canny = gr.Button("Run", visible=False)
|
305 |
+
|
306 |
+
all_run_btns = [run_btn_lineart, run_btn_canny]
|
307 |
+
|
308 |
+
tab_lineart.select(fn=set_inputs("Lineart"), inputs=None, outputs=all_run_btns)
|
309 |
+
|
310 |
with gr.Column(scale=2):
|
311 |
gallery = gr.Gallery(label="Generated images", show_label=False, interactive=False, format="png", elem_id="output_gallery", elem_classes="output-gallery", columns=[3], rows=[2], object_fit="contain", height="auto", type="filepath")
|
312 |
|