Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate video #3

Open
Niutonian opened this issue May 24, 2023 · 7 comments
Open

Can't generate video #3

Niutonian opened this issue May 24, 2023 · 7 comments

Comments

@Niutonian
Copy link

Hello, I can't get it to work,
I have two Auto1111 installs with torch 1.13 and 2.0 but it crashes on both,
Here's the output:

""" File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict
output = await app.get_blocks().process_api(
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1299, in process_api
result = await self.call_function(
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1022, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\AI\stable-diffusion-webui\extensions\vid-faceswap\scripts\vid_faceswap.py", line 67, in process_video
frames_data, fps, audio = video_reader(video_input, max_fps=max_fps if max_fps > 0 else None)
File "C:\AI\stable-diffusion-webui\extensions\vid-faceswap\scripts\video.py", line 11, in video_reader
return _ffmpeg_reader(file, max_fps)
File "C:\AI\stable-diffusion-webui\extensions\vid-faceswap\scripts\video.py", line 31, in _ffmpeg_reader
with VideoFileClip(file) as clip:
AttributeError: enter
"""

How can I fix it,
Best,

@dchatel
Copy link
Owner

dchatel commented May 24, 2023

Which version of moviepy have you installed ?
Also, ffmpeg needs to be installed and accessible by moviepy. One good way to do it is add the folder where ffmpeg.exe is in your PATH, since you probably want to be able to use it from anywhere, anyway.

@sti320a
Copy link

sti320a commented Jun 1, 2023

I encountered the same error, I added the folder with ffmpeg.exe to my PATH.
The version of moviepy I installed is 1.0.3.

This problem seems to be caused by VideoFileClip not supporting the with syntax.

Can you tell me which version of libraries I should use?
Or can you provide me with something like requirements.txt?

@dchatel
Copy link
Owner

dchatel commented Jun 1, 2023

I'm using moviepy 1.0.3 and for ffmpeg:

ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)

@dchatel
Copy link
Owner

dchatel commented Jun 1, 2023

Could you try to run a very small script which does the following ?

from moviepy.editor import VideoFileClip

with VideoFileClip('path/to/video-file') as clip:
  frames = list(clip.iter_frames())

@sti320a
Copy link

sti320a commented Jun 1, 2023

Could you try to run a very small script which does the following ?

from moviepy.editor import VideoFileClip

with VideoFileClip('path/to/video-file') as clip:
  frames = list(clip.iter_frames())

This script worked fine.
Then I noticed that I needed to install moviepy in Stable Diffusion's venv environment.

path\to\stable-diffusion-webui> .\venv\Scripts\activate   
(venv) > pip install moviepy==1.0.3

This solved the above problem.
Thanks for your help.

After resolving this issue, I ran into another error.
I'm currently investigating.
Please let me know if you know anything about it.

TypeError: FaceAnalysis.__init__() got an unexpected keyword argument 'providers'

Thank you.

@dchatel
Copy link
Owner

dchatel commented Jun 4, 2023

It could be related to the wrong version of insightface. You should use 0.7.3 and not 0.2.1. You can fix that by running pip install -U insightface in the stable diffusion environment.

@sti320a
Copy link

sti320a commented Jun 5, 2023

It could be related to the wrong version of insightface. You should use 0.7.3 and not 0.2.1. You can fix that by running pip install -U insightface in the stable diffusion environment.

After executing the command, insightface v0.7.3 was installed and it worked!
Thank you !!

path\to\stable-diffusion-webui> .\venv\Scripts\activate   
(venv) > pip install -U insightface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants