fix gradio again
diff --git a/webui.py b/webui.py
index 0bd9792a1..e5b9c5f9e 100644
--- a/webui.py
+++ b/webui.py
@@ -79,31 +79,8 @@ def stop_clicked():
                                         _js="(x) => {if(x){setTimeout(() => window.scrollTo({ top: window.scrollY + 500, behavior: 'smooth' }), 50);}else{setTimeout(() => window.scrollTo({ top: 0, behavior: 'smooth' }), 50);} return x}")
 
             current_tab = gr.Textbox(value='uov', visible=False)
-
-            def get_image_cacher(flag):
-                def inner_func(previous_flag, *prs):
-                    global last_image
-
-                    index = {
-                        'uov': 0,
-                        'inpaint': 1
-                    }[previous_flag]
-
-                    x = prs[index]
-
-                    if isinstance(x, dict):
-                        last_image = x['image']
-                    else:
-                        last_image = x
-
-                    return flag, last_image
-
-                return inner_func
-
-            tab_img_swap_ctrls = [current_tab, uov_input_image, inpaint_input_image]
-
-            uov_tab.select(get_image_cacher('uov'), inputs=tab_img_swap_ctrls, outputs=[current_tab, uov_input_image], queue=False)
-            inpaint_tab.select(get_image_cacher('inpaint'), inputs=tab_img_swap_ctrls, outputs=[current_tab, inpaint_input_image], queue=False)
+            uov_tab.select(lambda: 'uov', outputs=current_tab, queue=False)
+            inpaint_tab.select(lambda: 'inpaint', outputs=current_tab, queue=False)
 
         with gr.Column(scale=0.5, visible=False) as right_col:
             with gr.Tab(label='Setting'):
