AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
135.69k stars 25.9k forks source link

[Bug]: The SadTalker extension hasn't been working for months. #15949

Open MisterT96 opened 1 month ago

MisterT96 commented 1 month ago

Checklist

What happened?

SadTalker last worked for me under version 1.7.0 and hasn't worked since. Has anyone found a solution for this or does anyone still have version 1.7.0 and could make it available for download?

I used a new installation of stable-diffusion-webui and encounter errors as soon as I install SadTalker. I am using "Installation on Windows 10/11 with NVidia-GPUs using release package" and Python 3.10.6.

Errors like: AttributeError: module 'numpy' has no attribute 'complex'. np.complex was a deprecated alias for the builtin complex. To avoid this error in existing code, use complex by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.complex128 here. The alias was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

The error seems to occur because SadTalker hasn't been updated for many months.

Who can help?

Steps to reproduce the problem

clean installation Try to install SadTalker with webui.

What should have happened?

SadTalker should have worked.

What browsers do you use to access the UI ?

No response

Sysinfo

All requirements are met.

Console logs

All requirements are met.

Additional information

No response

w-e-w commented 1 month ago

all versions are available in the Repository, no need to ask any one for old version https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases

or you could just switch to the version you want by running a quick command git checkout v1.8.0 in webui root

that being said

AttributeError: module 'numpy' has no attribute 'complex'.
np.complex was a deprecated alias for the builtin complex. 

I highly doubt that is the cause of the issue of it not working because numpy version used by webui was last change in the 1.8.0 release, which you said to be working

MisterT96 commented 1 month ago

git checkout v1.8.0

Thank you for that switching method. Regarding the second problem, my error log is:

*** Error executing callback ui_tabs_callback for C:\Users\Username\Desktop\stable-diffusion-webui\extensions\SadTalker\scripts\extension.py
    Traceback (most recent call last):
      File "C:\Users\Username\Desktop\stable-diffusion-webui\modules\script_callbacks.py", line 180, in ui_tabs_callback
        res += c.callback() or []
      File "C:\Users\Username\Desktop\stable-diffusion-webui\extensions\SadTalker\scripts\extension.py", line 172, in on_ui_tabs
        from app import sadtalker_demo
      File "C:\Users\Username\Desktop\stable-diffusion-webui/extensions/SadTalker\app.py", line 3, in <module>
        from src.gradio_demo import SadTalker
      File "C:\Users\Username\Desktop\stable-diffusion-webui/extensions/SadTalker\src\gradio_demo.py", line 6, in <module>
        from src.generate_batch import get_data
      File "C:\Users\Username\Desktop\stable-diffusion-webui/extensions/SadTalker\src\generate_batch.py", line 8, in <module>
        import src.utils.audio as audio
      File "C:\Users\Username\Desktop\stable-diffusion-webui/extensions/SadTalker\src\utils\audio.py", line 1, in <module>
        import librosa
      File "C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\librosa\__init__.py", line 211, in <module>
        from . import core
      File "C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\librosa\core\__init__.py", line 9, in <module>
        from .constantq import *  # pylint: disable=wildcard-import
      File "C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\librosa\core\constantq.py", line 1058, in <module>
        dtype=np.complex,
      File "C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\numpy\__init__.py", line 338, in __getattr__
        raise AttributeError(__former_attrs__[attr])
    AttributeError: module 'numpy' has no attribute 'complex'.
    `np.complex` was a deprecated alias for the builtin `complex`. To avoid this error in existing code, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
    The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
        https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

I highly doubt that is the cause of the issue of it not working because numpy version used by webui was last change in the 1.8.0 release, which you said to be working

Yeah, my mistake. Version 1.8.0 is not working. But version 1.7.0 is working all fine. So thank you for writing me that version change command. A+ experience!

w-e-w commented 1 month ago
       File "C:\Users\Username\Desktop\stable-diffusion-webui/extensions/SadTalker\src\utils\audio.py", line 1, in <module>
        import librosa

seeing this I think the issue is version compatibility issue with librosa==0.9.2 and numpy==1.26.2