numz / sd-wav2lip-uhq

Wav2Lip UHQ extension for Automatic1111
Apache License 2.0
1.23k stars 163 forks source link

Errors when trying to generate #5

Closed G-Grifflu closed 1 year ago

G-Grifflu commented 1 year ago

Hi. First, the link to s3fd.pth is broken. But I found it elsewhere.

Then, when I try to generate, I get the following errors:

File "C:\StableDiff\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict output = await app.get_blocks().process_api( File "C:\StableDiff\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api result = await self.call_function( File "C:\StableDiff\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function prediction = await anyio.to_thread.run_sync( File "C:\StableDiff\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\StableDiff\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\StableDiff\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\StableDiff\extensions\sd-wav2lip-uhq\scripts\ui.py", line 43, in generate w2l.execute() File "C:\StableDiff\extensions\sd-wav2lip-uhq\scripts\wav2lip\w2l.py", line 223, in execute mel = audio.melspectrogram(wav) File "C:\StableDiff\extensions\sd-wav2lip-uhq\scripts\wav2lip\audio.py", line 47, in melspectrogram S = _amp_to_db(_linear_to_mel(np.abs(D))) - hp.ref_level_db File "C:\StableDiff\extensions\sd-wav2lip-uhq\scripts\wav2lip\audio.py", line 95, in _linear_to_mel _mel_basis = _build_mel_basis() File "C:\StableDiff\extensions\sd-wav2lip-uhq\scripts\wav2lip\audio.py", line 100, in _build_mel_basis return librosa.filters.mel(hp.sample_rate, hp.n_fft, n_mels=hp.num_mels, TypeError: mel() takes 0 positional arguments but 2 positional arguments (and 3 keyword-only arguments) were given

numz commented 1 year ago

Hi, Thanks for report, can you give me the version of your librosa package please? in command line try : pip list

regards

OmriCBT commented 1 year ago

I'm getting the same error. my librosa ver is - 0.10.0.post2

G-Grifflu commented 1 year ago

Librosa didn't appear in the pip list. So I installed it, version 0.10.0.post2. But the generation results in the same exact errors.

numz commented 1 year ago

You have to make "pip list" in the stable-diffusion environnement: you probably have a "venv" or "env" folder in "C:\StableDiff\" if so, try this :

C:\StableDiff\venv\Scripts\activate pip list

if librosa version is different of 0.8.0 do : pip install librosa==0.8.0

OmriCBT commented 1 year ago

Installed ver 0.8.0 and still the same error

numz commented 1 year ago

ok... did you restart the web ui after update librosa ? if so, please , can you open file :

C:\StableDiff\venv\lib\site-packages\venv\Lib\site-packages\librosa\filters.py search for function "def mel" and copy/paste here the lines arround 112 and to 122.

it must be something like this :

@cache(level=10) def mel( sr, n_fft, n_mels=128, fmin=0.0, fmax=None, htk=False, norm="slaney", dtype=np.float32, ):

thank you for your help :)

OmriCBT commented 1 year ago

Thank you! I'm actually running SD on paperspace cloud (ubuntu), where should I find it here?

numz commented 1 year ago

Ubuntu? but path look like windows style, no? I don't know how works paperspace... do you have access to a terminal?

G-Grifflu commented 1 year ago

OK so I downloaded the correct version of librosa in the venv. Then I updated your extension to the latest version, rebooted Auto1111 completely. I started a generation and got almost the same errors, with the last line saying that the wav2lip_gan.pth was missing. I checked and realized I put the pth files in the wrong folder. So I moved them.

And I'm happy to say that it now works! I could generate a video.

So thank you for your help.

numz commented 1 year ago

Thank you!!!!!!!!!!!!!!!!!!!!!! really appreciate :)

I close the issue !

regards

OmriCBT commented 1 year ago

Ubuntu? but path look like windows style, no? I don't know how works paperspace... do you have access to a terminal?

Edit: sorry, missed the part of downloading the model files.. you can close this Yes I have access to a terminal and am familiar with doing very basic things