Gourieff / sd-webui-reactor

Fast and Simple Face Swap Extension for StableDiffusion WebUI (A1111 SD WebUI, SD WebUI Forge, SD.Next, Cagliostro)
GNU Affero General Public License v3.0
2.54k stars 277 forks source link

ReActor extension not working on forge after update to gradio 4 #507

Closed Darknessssenkrad closed 1 month ago

Darknessssenkrad commented 2 months ago

First, confirm

What happened?

some buttons on the extension doesn't work (for example to acces the models section of the extension)

Steps to reproduce the problem

  1. Go to reactor extension
  2. Press models section
  3. doenst work

Sysinfo

tested locally and google colab

Relevant console log

nothing showing just can't clic it

Additional information

No response

sorrydaijin commented 2 months ago

I am having a similar issue. The console shows this:

Traceback (most recent call last):
  File "K:\AI\Forge\system\python\lib\site-packages\gradio\queueing.py", line 536, in process_events
    response = await route_utils.call_process_api(
  File "K:\AI\Forge\system\python\lib\site-packages\gradio\route_utils.py", line 285, in call_process_api
    output = await app.get_blocks().process_api(
  File "K:\AI\Forge\system\python\lib\site-packages\gradio\blocks.py", line 1923, in process_api
    result = await self.call_function(
  File "K:\AI\Forge\system\python\lib\site-packages\gradio\blocks.py", line 1508, in call_function
    prediction = await anyio.to_thread.run_sync(  # type: ignore
  File "K:\AI\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 "K:\AI\Forge\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "K:\AI\Forge\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "K:\AI\Forge\system\python\lib\site-packages\gradio\utils.py", line 818, in wrapper
    response = f(*args, **kwargs)
  File "K:\AI\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'

Swapping with a single image is working.

Darknessssenkrad commented 2 months ago

yeah swapping with a single image it's ok but sucks cause the models are always way better! I bet it's a simple fix but I'm don't know enough python to fix it! :(

RichardGoldbergSchool commented 2 months ago

.update is deprecated in the most recent update of Gradio. If you get rid of all instances of .update in reactor_main_ui.py it fixes the problem. As an example

control_col_1: gr.Column.update(visible=False)

should just be:

control_col_1: gr.Column(visible=False)

Mikk702 commented 2 months ago

.update is deprecated in the most recent update of Gradio. If you get rid of all instances of .update in reactor_main_ui.py it fixes the problem. As an example

control_col_1: gr.Column.update(visible=False)

should just be:

control_col_1: gr.Column(visible=False)

It worked! Thank You!

Darknessssenkrad commented 2 months ago

.update is deprecated in the most recent update of Gradio. If you get rid of all instances of .update in reactor_main_ui.py it fixes the problem. As an example

control_col_1: gr.Column.update(visible=False)

should just be:

control_col_1: gr.Column(visible=False)

.update is deprecated in the most recent update of Gradio. If you get rid of all instances of .update in reactor_main_ui.py it fixes the problem. As an example

control_col_1: gr.Column.update(visible=False)

should just be:

control_col_1: gr.Column(visible=False)

YES that was it! thank you so much! <3

Rostezkiy commented 2 months ago

reactor_main_ui.zip

Fixed file, for those who needs one-click solution.

jassde commented 2 months ago

still does not work for me tried both fixes

Darknessssenkrad commented 2 months ago

https://github.com/Darknessssenkrad/sd-webui-reactorGR4 try this repo it's a fork of the original just with the fixes on main gui, I install it directly from there since every time I run forge it's on a colab notebook and it works :)

Gourieff commented 2 months ago

Hi guys, will be fixed soon

Gourieff commented 2 months ago

Fixed Related https://github.com/Gourieff/sd-webui-reactor/issues/496 https://github.com/Gourieff/sd-webui-reactor/issues/491

soyv4 commented 2 months ago

Can you tell me what the error is and how to fix it?

*** Error running process: D:\webui_forge_124\webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py Traceback (most recent call last): File "urllib\request.py", line 1348, in do_open File "http\client.py", line 1282, in request File "http\client.py", line 1328, in _send_request File "http\client.py", line 1277, in endheaders File "http\client.py", line 1037, in _send_output File "http\client.py", line 975, in send File "http\client.py", line 1454, in connect File "ssl.py", line 513, in wrap_socket File "ssl.py", line 1071, in _create File "ssl.py", line 1342, in do_handshake ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\webui_forge_124\webui\modules\scripts.py", line 844, in process
    script.process(p, *script_args)
  File "D:\webui_forge_124\webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 296, in process
    result, output, swapped = swap_face(
  File "D:\webui_forge_124\webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 616, in swap_face
    result_image, output, swapped = operate(source_img,target_img,target_img_orig,model,source_faces_index,faces_index,source_faces,target_faces,gender_source,gender_target,source_face,wrong_gender,source_age,source_gender,output,swapped,mask_face,entire_mask_image,enhancement_options,detection_options)
  File "D:\webui_forge_124\webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 812, in operate
    result_image = enhance_image(result_image, enhancement_options)
  File "D:\webui_forge_124\webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 217, in enhance_image
    result_image = restore_face(result_image, enhancement_options)
  File "D:\webui_forge_124\webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 172, in restore_face
    numpy_image = codeformer_model.codeformer.restore(
  File "D:\webui_forge_124\webui\modules\codeformer_model.py", line 55, in restore
    return self.restore_with_helper(np_image, restore_face)
  File "D:\webui_forge_124\webui\modules\face_restoration_utils.py", line 158, in restore_with_helper
    self.send_model_to(self.get_device())
  File "D:\webui_forge_124\webui\modules\face_restoration_utils.py", line 133, in send_model_to
    if self.face_helper:
  File "functools.py", line 981, in __get__
  File "D:\webui_forge_124\webui\modules\face_restoration_utils.py", line 127, in face_helper
    return create_face_helper(self.get_device())
  File "D:\webui_forge_124\webui\modules\face_restoration_utils.py", line 48, in create_face_helper
    return FaceRestoreHelper(
  File "D:\webui_forge_124\system\python\lib\site-packages\facexlib\utils\face_restoration_helper.py", line 99, in __init__
    self.face_det = init_detection_model(det_model, half=False, device=self.device, model_rootpath=model_rootpath)
  File "D:\webui_forge_124\system\python\lib\site-packages\facexlib\detection\__init__.py", line 18, in init_detection_model
    model_path = load_file_from_url(
  File "D:\webui_forge_124\webui\modules\face_restoration_utils.py", line 176, in facex_load_file_from_url
    return det_facex_load_file_from_url(**update_kwargs(kwargs))
  File "D:\webui_forge_124\system\python\lib\site-packages\facexlib\utils\misc.py", line 77, in load_file_from_url
    download_url_to_file(url, cached_file, hash_prefix=None, progress=progress)
  File "D:\webui_forge_124\system\python\lib\site-packages\torch\hub.py", line 624, in download_url_to_file
    u = urlopen(req)
  File "urllib\request.py", line 216, in urlopen
  File "urllib\request.py", line 519, in open
  File "urllib\request.py", line 536, in _open
  File "urllib\request.py", line 496, in _call_chain
  File "urllib\request.py", line 1391, in https_open
  File "urllib\request.py", line 1351, in do_open
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>