Skip to content

Commit

Permalink
Don't show progress for UI actions (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
missionfloyd authored Oct 15, 2023
1 parent 9983402 commit df0788b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions scripts/controlnet_ui/controlnet_ui_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def closesteight(num):
fn=send_dimensions,
inputs=[self.image],
outputs=outputs,
show_progress=False
)

def register_webcam_toggle(self):
Expand All @@ -466,14 +467,14 @@ def webcam_toggle():
"__type__": "update",
}

self.webcam_enable.click(webcam_toggle, inputs=None, outputs=self.image)
self.webcam_enable.click(webcam_toggle, inputs=None, outputs=self.image, show_progress=False)

def register_webcam_mirror_toggle(self):
def webcam_mirror_toggle():
self.webcam_mirrored = not self.webcam_mirrored
return {"mirror_webcam": self.webcam_mirrored, "__type__": "update"}

self.webcam_mirror.click(webcam_mirror_toggle, inputs=None, outputs=self.image)
self.webcam_mirror.click(webcam_mirror_toggle, inputs=None, outputs=self.image, show_progress=False)

def register_refresh_all_models(self):
def refresh_all_models(*inputs):
Expand All @@ -485,7 +486,7 @@ def refresh_all_models(*inputs):
value=selected, choices=list(global_state.cn_models.keys())
)

self.refresh_models.click(refresh_all_models, self.model, self.model)
self.refresh_models.click(refresh_all_models, self.model, self.model, show_progress=False)

def register_build_sliders(self):
if not self.gradio_compat:
Expand Down Expand Up @@ -584,8 +585,8 @@ def build_sliders(module: str, pp: bool):
self.refresh_models,
self.control_mode
]
self.module.change(build_sliders, inputs=inputs, outputs=outputs)
self.pixel_perfect.change(build_sliders, inputs=inputs, outputs=outputs)
self.module.change(build_sliders, inputs=inputs, outputs=outputs, show_progress=False)
self.pixel_perfect.change(build_sliders, inputs=inputs, outputs=outputs, show_progress=False)

if self.type_filter is not None:

Expand Down Expand Up @@ -619,6 +620,7 @@ def filter_selected(k: str):
filter_selected,
inputs=[self.type_filter],
outputs=[self.module, self.model],
show_progress=False
)

def register_run_annotator(self, is_img2img: bool):
Expand Down Expand Up @@ -749,18 +751,21 @@ def shift_preview(is_on):
self.openpose_editor.download_link,
self.openpose_editor.modal,
],
show_progress=False
)

def register_create_canvas(self):
self.open_new_canvas_button.click(
lambda: gr.Accordion.update(visible=True),
inputs=None,
outputs=self.create_canvas,
show_progress=False
)
self.canvas_cancel_button.click(
lambda: gr.Accordion.update(visible=False),
inputs=None,
outputs=self.create_canvas,
show_progress=False
)

def fn_canvas(h, w):
Expand All @@ -772,6 +777,7 @@ def fn_canvas(h, w):
fn=fn_canvas,
inputs=[self.canvas_height, self.canvas_width],
outputs=[self.image, self.create_canvas],
show_progress=False
)

def register_img2img_same_input(self):
Expand All @@ -794,6 +800,7 @@ def fn_same_checked(x):
self.loopback,
self.resize_mode,
],
show_progress=False
)
return

Expand Down

0 comments on commit df0788b

Please sign in to comment.