enlyth / sd-webui-riffusion

Riffusion extension for AUTOMATIC1111's SD Web UI
MIT License
195 stars 23 forks source link

Couldn't find ffprobe or avprobe #5

Closed thezveroboy closed 1 year ago

thezveroboy commented 1 year ago

last version of the plugin works fine only one time after running automatic1111. but if i try to run generation again i'm getting this error. if i close automatic1111 webui and restart it, it will work only one time and second time will be broken

I:\stable-diffusion-webui\venv\lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning) Traceback (most recent call last): File "I:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict output = await app.blocks.process_api( File "I:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 980, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "I:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 891, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "I:\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1845, in preprocess sample_rate, data = processing_utils.audio_from_file( File "I:\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 204, in audio_from_file data = np.array(audio.get_array_of_samples()) UnboundLocalError: local variable 'audio' referenced before assignment

enlyth commented 1 year ago

Could be related to not having ffmpeg installed/or the binaries not being in your PATH, if I'm reading that correctly gradio uses pydub which depends on ffmpeg

thezveroboy commented 1 year ago

thanks for the answer!

for the first version of the plugin, I installed these libraries and set them to variables as it was described in the requirements.

after updating the plugin, the requirements for installing ffmpeg were removed from the page and I removed these libraries as unnecessary.

Now the requirement to install these libraries has reappeared. it turns out I was misled by the description on the plugin page.

Another question is how to understand this phrase then:

Replace pydub with pedalboard (removes ffmpeg issue for people who don't have it)

does this description refer to ffmpeg libraries or does it refer to pydub?

And in the last question: why, when I start automatic1111, I get a melody, and only then everything flies? It turns out that the riffusion plugin can work without additional libraries and dependencies, but is there something that interferes with it in the code of the plugin itself?

thezveroboy commented 1 year ago

after all, my main question is:

why, without the ffmpeg libraries installed, the plugin works once after starting automatic1111, but does not work the second time, giving the above error. and if you reload the application, it will work fine again once and when you try a new generation, it will again give an error?

that is, everything works without libraries, but once for each launch. why?

enlyth commented 1 year ago

why, without the ffmpeg libraries installed, the plugin works once after starting automatic1111

Your guess is as good as mine mate, strange behaviour

I think what's going on is, gradio uses pydub under the hood anyway for its inline audio components to preprocess it before it is displayed, so after switching my plugin to use pedalboard instead, I momentarily removed the ffmpeg advisory from the readme until I realized that it is still required.