Commit
·
0479306
1
Parent(s):
0b2ea27
28. Sept. 2024, 14:08
Browse files
app.py
CHANGED
|
@@ -273,10 +273,13 @@ with gr.Blocks(theme=theme, css=custom_css, js=custom_js, head=custom_head, titl
|
|
| 273 |
gr.Markdown("<p>Check Invert to use with Mochi Diffusion. Inverted image can also be created here for use with ControlNet Scribble.")
|
| 274 |
with gr.Row():
|
| 275 |
with gr.Column():
|
|
|
|
|
|
|
| 276 |
preprocessor_name = gr.Radio(label="Preprocessor", show_label=False, choices=["Lineart", "Lineart Coarse", "Lineart Anime"], type="value", value="Lineart")
|
| 277 |
-
invert = gr.Checkbox(label="
|
| 278 |
-
resolution = gr.Slider(label="
|
| 279 |
run_btn_lineart = gr.Button("Run")
|
|
|
|
| 280 |
|
| 281 |
## TAB Canny
|
| 282 |
with gr.Tab("Canny Edge"):
|
|
|
|
| 273 |
gr.Markdown("<p>Check Invert to use with Mochi Diffusion. Inverted image can also be created here for use with ControlNet Scribble.")
|
| 274 |
with gr.Row():
|
| 275 |
with gr.Column():
|
| 276 |
+
invert_toggle_info = ["Schwarzer Hintergrund, Weiße Linien", "Weißer Hintergrund, Schwarze Linien"]
|
| 277 |
+
print(invert_toggle_info[0])
|
| 278 |
preprocessor_name = gr.Radio(label="Preprocessor", show_label=False, choices=["Lineart", "Lineart Coarse", "Lineart Anime"], type="value", value="Lineart")
|
| 279 |
+
invert = gr.Checkbox(label="Farbe invertieren?", info=invert_toggle_info[0], value=True, elem_classes="toggle-btn")
|
| 280 |
+
resolution = gr.Slider(label="Auflösung", minimum=256, maximum=1024, value=512, step=64)
|
| 281 |
run_btn_lineart = gr.Button("Run")
|
| 282 |
+
invert.change(lambda x: {"info": invert_toggle_info[0] if x else invert_toggle_info[1], "__type__": "update"}, inputs=checkbox, outputs=checkbox)
|
| 283 |
|
| 284 |
## TAB Canny
|
| 285 |
with gr.Tab("Canny Edge"):
|