Spaces:
Running
on
Zero
Running
on
Zero
Gainward777
commited on
Commit
•
effbd63
1
Parent(s):
97293f9
Upload gradio_ui.py
Browse files- ui/gradio_ui.py +29 -29
ui/gradio_ui.py
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
def ui(get_first_result,get_second_result): #controller):
|
4 |
-
with gr.Blocks() as ui:
|
5 |
-
with gr.Row():
|
6 |
-
with gr.Column():
|
7 |
-
sketch=gr.Image(sources = 'upload', label='Model image', type = 'pil')
|
8 |
-
first_prompt = gr.Textbox(label="Prompt", lines=3)
|
9 |
-
first_negative_prompt = gr.Textbox(label="Negative prompt", lines=3, value="sketch, lowres, error, extra digit, fewer digits, cropped, worst quality,low quality, normal quality, jpeg artifacts, blurry")
|
10 |
-
#controlnet_scale = gr.Slider(minimum=0.5, maximum=1.25, value=0.5, step=0.01, label="Contr")
|
11 |
-
improve_sketch = gr.Button(value="Improve Sketch", variant="primary")
|
12 |
-
with gr.Column():
|
13 |
-
improved_sketch_view = gr.Image(type="pil", label="Improved Sketch")
|
14 |
-
|
15 |
-
improve_sketch.click(fn=
|
16 |
-
inputs=[sketch, first_prompt, first_negative_prompt],
|
17 |
-
outputs=improved_sketch_view)
|
18 |
-
|
19 |
-
with gr.Row():
|
20 |
-
result=gr.Image(type="pil", label="
|
21 |
-
second_prompt = gr.Textbox(label="Prompt", lines=3)
|
22 |
-
second_negative_prompt = gr.Textbox(label="Negative prompt", lines=3, value="disfigured, extra digit, fewer digits, cropped, worst quality, low quality")
|
23 |
-
result_button = gr.Button(value="Paint It", variant="primary")
|
24 |
-
|
25 |
-
result_button.click(fn=
|
26 |
-
inputs=[
|
27 |
-
outputs=result)
|
28 |
-
|
29 |
-
|
30 |
ui.queue().launch(debug=True)
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def ui(controller):#get_first_result,get_second_result): #controller):
|
4 |
+
with gr.Blocks() as ui:
|
5 |
+
with gr.Row():
|
6 |
+
with gr.Column():
|
7 |
+
sketch=gr.Image(sources = 'upload', label='Model image', type = 'pil')
|
8 |
+
first_prompt = gr.Textbox(label="Prompt", lines=3)
|
9 |
+
first_negative_prompt = gr.Textbox(label="Negative prompt", lines=3, value="sketch, lowres, error, extra digit, fewer digits, cropped, worst quality,low quality, normal quality, jpeg artifacts, blurry")
|
10 |
+
#controlnet_scale = gr.Slider(minimum=0.5, maximum=1.25, value=0.5, step=0.01, label="Contr")
|
11 |
+
improve_sketch = gr.Button(value="Improve Sketch", variant="primary")
|
12 |
+
with gr.Column():
|
13 |
+
improved_sketch_view = gr.Image(type="pil", label="Improved Sketch")
|
14 |
+
|
15 |
+
improve_sketch.click(fn=controller.get_first_result,
|
16 |
+
inputs=[sketch, first_prompt, first_negative_prompt],
|
17 |
+
outputs=improved_sketch_view)
|
18 |
+
|
19 |
+
with gr.Row():
|
20 |
+
result=gr.Image(type="pil", label="Improved Sketch")
|
21 |
+
second_prompt = gr.Textbox(label="Prompt", lines=3)
|
22 |
+
second_negative_prompt = gr.Textbox(label="Negative prompt", lines=3, value="disfigured, extra digit, fewer digits, cropped, worst quality, low quality")
|
23 |
+
result_button = gr.Button(value="Paint It", variant="primary")
|
24 |
+
|
25 |
+
result_button.click(fn=controller.get_second_result,
|
26 |
+
inputs=[improve_sketch, second_prompt, second_negative_prompt],
|
27 |
+
outputs=result)
|
28 |
+
|
29 |
+
|
30 |
ui.queue().launch(debug=True)
|