lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
7.22k stars 696 forks source link

[BUG] reactor - faceswape dont work anymore since new update #889

Open kalle07 opened 1 month ago

kalle07 commented 1 month ago

seem all not internal extension dont work (same like supermerger)

File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\queueing.py", line 536, in process_events response = await route_utils.call_process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api output = await app.get_blocks().process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1923, in process_api result = await self.call_function( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1508, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore File "e:\WebUI_Forge\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\utils.py", line 818, in wrapper response = f(args, kwargs) File "E:\WebUI_Forge\webui\extensions\sd-webui-reactor\reactor_ui\reactor_main_ui.py", line 44, in on_select_source control_col_1: gr.Column.update(visible=False), AttributeError: type object 'Column' has no attribute 'update' Traceback (most recent call last): File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\queueing.py", line 536, in process_events response = await route_utils.call_process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api output = await app.get_blocks().process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1923, in process_api result = await self.call_function( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1508, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore File "e:\WebUI_Forge\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\utils.py", line 818, in wrapper response = f(args, kwargs) File "E:\WebUI_Forge\webui\extensions\sd-webui-reactor\reactor_ui\reactor_main_ui.py", line 28, in on_select_source control_col_1: gr.Column.update(visible=False), AttributeError: type object 'Column' has no attribute 'update' Traceback (most recent call last): File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\queueing.py", line 536, in process_events response = await route_utils.call_process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api output = await app.get_blocks().process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1923, in process_api result = await self.call_function( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1508, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore File "e:\WebUI_Forge\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\utils.py", line 818, in wrapper response = f(args, kwargs) File "E:\WebUI_Forge\webui\extensions\sd-webui-reactor\reactor_ui\reactor_main_ui.py", line 44, in on_select_source control_col_1: gr.Column.update(visible=False), AttributeError: type object 'Column' has no attribute 'update' Traceback (most recent call last): File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\queueing.py", line 536, in process_events response = await route_utils.call_process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api output = await app.get_blocks().process_api( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1923, in process_api result = await self.call_function( File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\blocks.py", line 1508, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore File "e:\WebUI_Forge\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "e:\WebUI_Forge\system\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "e:\WebUI_Forge\system\python\lib\site-packages\gradio\utils.py", line 818, in wrapper response = f(args, kwargs) File "E:\WebUI_Forge\webui\extensions\sd-webui-reactor\reactor_ui\reactor_main_ui.py", line 36, in on_select_source control_col_1: gr.Column.update(visible=True), AttributeError: type object 'Column' has no attribute 'update'

SpydirRoot commented 1 month ago

Same issue here after update.

EDIT: 'update' is depreciated in Gradio 4.x

Replace lines 27-49 of reactor_main_ui.py with:

            return {
               control_col_1: gr.Column(visible=False),
               control_col_2: gr.Column(visible=False),
               control_col_3: gr.Column(visible=True),
                # save_original: gr.Checkbox.update(value=False,visible=False),
                imgs_hash_clear: gr.Button(visible=True)
            }
        if evt.index == 0:
            return {
               control_col_1: gr.Column(visible=True),
               control_col_2: gr.Column(visible=False),
               control_col_3: gr.Column(visible=False),
                # save_original: gr.Checkbox.update(value=SAVE_ORIGINAL,visible=show_br),
                imgs_hash_clear: gr.Button(visible=False)
            }
        if evt.index == 1:
            return {
               control_col_1: gr.Column(visible=False),
               control_col_2: gr.Column(visible=True),
               control_col_3: gr.Column(visible=False),
                # save_original: gr.Checkbox.update(value=SAVE_ORIGINAL,visible=show_br),
                imgs_hash_clear: gr.Button(visible=False)
            }

Works for me, but I'm not a coder, so someone confirm I'm not breaking other things..

DenOfEquity commented 1 month ago

This also works for me, thanks SpydirRoot. I don't see any reason why this change would break anything, it's just an update to the new Gradio way. Possibly it'll need to be reapplied after Reactor updates.

javascriptdotexe commented 1 month ago

Facing the same issue, any workaround yet?

EuroCluddy commented 3 weeks ago

Same issue here after update.

EDIT: 'update' is depreciated in Gradio 4.x

Replace lines 27-49 of reactor_main_ui.py with:

            return {
               control_col_1: gr.Column(visible=False),
               control_col_2: gr.Column(visible=False),
               control_col_3: gr.Column(visible=True),
                # save_original: gr.Checkbox.update(value=False,visible=False),
                imgs_hash_clear: gr.Button(visible=True)
            }
        if evt.index == 0:
            return {
               control_col_1: gr.Column(visible=True),
               control_col_2: gr.Column(visible=False),
               control_col_3: gr.Column(visible=False),
                # save_original: gr.Checkbox.update(value=SAVE_ORIGINAL,visible=show_br),
                imgs_hash_clear: gr.Button(visible=False)
            }
        if evt.index == 1:
            return {
               control_col_1: gr.Column(visible=False),
               control_col_2: gr.Column(visible=True),
               control_col_3: gr.Column(visible=False),
                # save_original: gr.Checkbox.update(value=SAVE_ORIGINAL,visible=show_br),
                imgs_hash_clear: gr.Button(visible=False)
            }

Works for me, but I'm not a coder, so someone confirm I'm not breaking other things..

Absolute legend SpydirRoot. This worked a treat. Thanks!