Gainward777 commited on
Commit
1e32deb
·
verified ·
1 Parent(s): bea529c

Update ui/gradio_ui.py

Browse files
Files changed (1) hide show
  1. ui/gradio_ui.py +5 -1
ui/gradio_ui.py CHANGED
@@ -8,6 +8,10 @@ SER_SKETCH=Image.fromarray(np.zeros((1024,1024)))
8
  def get_img_from_sketchpad(img):
9
  return Image.fromarray(img["composite"])
10
 
 
 
 
 
11
  def ui(controller):#get_first_result,get_second_result): #controller):
12
  with gr.Blocks() as ui:
13
  with gr.Row():
@@ -43,7 +47,7 @@ def ui(controller):#get_first_result,get_second_result): #controller):
43
  inputs=[sketch, first_prompt, second_prompt],
44
  label='Examples. Be concrete as much as possible.')
45
 
46
- sketch.input(get_img_from_sketchpad, outputs=SER_SKETCH, inputs=sketch, show_progress="hidden")
47
 
48
  improve_sketch.click(fn=controller.get_first_result,
49
  inputs=[SER_SKETCH, first_prompt, first_negative_prompt], #[sketch, first_prompt, first_negative_prompt],
 
8
  def get_img_from_sketchpad(img):
9
  return Image.fromarray(img["composite"])
10
 
11
+ def set_ser_sketch(img):
12
+ global SER_SKETCH
13
+ SER_SKETCH=img
14
+
15
  def ui(controller):#get_first_result,get_second_result): #controller):
16
  with gr.Blocks() as ui:
17
  with gr.Row():
 
47
  inputs=[sketch, first_prompt, second_prompt],
48
  label='Examples. Be concrete as much as possible.')
49
 
50
+ sketch.input(get_img_from_sketchpad, outputs=set_ser_sketch, inputs=sketch, show_progress="hidden")
51
 
52
  improve_sketch.click(fn=controller.get_first_result,
53
  inputs=[SER_SKETCH, first_prompt, first_negative_prompt], #[sketch, first_prompt, first_negative_prompt],