LykosAI / StabilityMatrix

Multi-Platform Package Manager for Stable Diffusion
https://lykos.ai
GNU Affero General Public License v3.0
4.85k stars 315 forks source link

How to install ffmpeg with stability matrix? #677

Open ziilch opened 5 months ago

ziilch commented 5 months ago

I'm trying to do some cool stuff with animate diff combined with A detailer and control net combined with textual inversions and loras.

Currently I'm encountering an issue where inside the stability matrix terminal I notice it's saying it can't find FFMPEG and its reverting to OpenCV in this line of code:

AnimateDiff - ERROR - [AnimateDiff] Error extracting frames via ffmpeg: [WinError 2] The system cannot find the file specified, fall back to OpenCV.


Theres a ton of other code and errors like :

C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [814,0,0], thread: [56,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"

0%| | 0/20 [00:00<?, ?it/s]MemMon: Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner

File "D:\Stability Matrix\Data\Packages\Stable Diffusion WebUI\modules\memmon.py", line 53, in run free, total = self.cuda_mem_get_info() File "D:\Stability Matrix\Data\Packages\Stable Diffusion WebUI\modules\memmon.py", line 34, in cuda_mem_get_info return torch.cuda.mem_get_info(index) File "D:\Stability Matrix\Data\Packages\Stable Diffusion WebUI\venv\lib\site-packages\torch\cuda\memory.py", line 663, in mem_get_info return torch.cuda.cudart().cudaMemGetInfo(device)


and then I get a cuda error:

RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.


Now I am easily able to install FFMPEG within the version of python I have associated with the default file path when installing python into windows 11, I used a pip command and got it installed no problem using the various tutorials online. The issue is that doesn't interact with anything within stability diffusions web ui that stability matrix installed because its using a virtual version of python within the venv folder within the stable diffusion webui a1111 file structure. I also notice stability matrix is using python 3.10 and the version of python I personally installed onto windows is 3.12 so already it shows me they are entirely different installations of python.

Anytime I open up the python interpreter within the stability matrix file structure and try any of the get or pip commands it says I have a syntax error. I have a hunch I'm in the wrong terminal to perform those commands.

I've also tried going to settings within stability matrix and edit the environment variables to include the installation path for FFmpeg and that doesn't seem to work (though maybe I'm editing it incorrectly, you tell me)

I know I'm not the only one on the web with this issue, and honestly I'm confused why ffmpeg isn't included in stability matrix's installation of a1111 and its virtual version of python, seems like a critical thing a lot of people need and there isn't clear instructions on line on how to fix it specifically with stability matrix. For a system thats supposed to be easier to work with, this particular aspect has been pretty frustrating and you would think this would have been included at installation without needing extra effort from the end user.

Any help would be greatly appreciated and I'll pay it forward and relay the information on reddit and elsewhere on github to the other users who asked regarding this problem.

ziilch commented 5 months ago

Ok so I figured out how to install ffmpeg, but I'm still getting cuda error's

for anyone thats curious what worked for me:

download the install zip folder direct from ffmpeg, look for the "full build" Once you unzip the package put it directly into the root of "stable diffusion web ui" mine is D:\Stability Matrix\Data\Packages\Stable Diffusion WebUI put the three files from the zip directly into the root and I no longer get an ffmpeg error so it should be properly installed.

I'm however still getting RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

So any help would be appreciated.

fmh-DEV commented 16 hours ago

Mac m2?