nateraw / stable-diffusion-videos

Create 🔥 videos with Stable Diffusion by exploring the latent space and morphing between text prompts
Apache License 2.0
4.4k stars 421 forks source link

FileNotFoundError: [WinError 2] The system cannot find the file specified #50

Closed meet1919 closed 1 year ago

meet1919 commented 1 year ago

Images are generated in the folder specified but FFmpeg throws this error when creating the video.

from stable_diffusion_videos.stable_diffusion_walk import walk

walk(
    prompts=['a cat', 'a dog'],
    seeds=[10, 42],
    output_dir='dreams',     # Where images/videos will be saved
    name='animals_test',     # Subdirectory of output_dir where images/videos will be saved
    guidance_scale=8.5,      # Higher adheres to prompt more, lower lets model take the wheel
    num_steps=5,             # Change to 60-200 for better results...3-5 for testing
    num_inference_steps=50, 
    scheduler='klms',        # One of: "klms", "default", "ddim"
    disable_tqdm=False,      # Set to True to disable tqdm progress bar
    make_video=True,         # If false, just save images
    use_lerp_for_text=True,  # Use lerp for text embeddings instead of slerp
    do_loop=False,           # Change to True if you want last prompt to loop back to first prompt
)
Traceback (most recent call last):
  File "c:\python\Projects\stable-diffusion\stable-generator.py", line 3, in <module>
    walk(
  File "C:\python\Projects\Gesture Scrolling\keyvenv\lib\site-packages\stable_diffusion_videos\stable_diffusion_walk.py", line 288, in walk
    return make_video_ffmpeg(output_path, f"{name}.mp4", fps=fps, frame_filename=f"frame%06d{frame_filename_ext}")
  File "C:\python\Projects\Gesture Scrolling\keyvenv\lib\site-packages\stable_diffusion_videos\stable_diffusion_walk.py", line 66, in make_video_ffmpeg
    subprocess.call(
  File "C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
nateraw commented 1 year ago

Do you know the root cause of this issue? Is it the ffmpeg command itself? Like do we have to point to something other than ffmpeg when calling subprocess?

meet1919 commented 1 year ago

Yes, you are correct. From subprocess.py file I made some temporary changes and everything worked for me.

def __init__(self, args, bufsize=-1, executable=None,
                 stdin=None, stdout=None, stderr=None,
                 preexec_fn=None, close_fds=True,
                 shell="True", cwd=None, env=None, universal_newlines=None,
                 startupinfo=None, creationflags=0,
                 restore_signals=True, start_new_session=False,
                 pass_fds=(), *, user=None, group=None, extra_groups=None,
                 encoding=None, errors=None, text=None, umask=-1):

changed : shell = True from false

nateraw commented 1 year ago

Interesting. That should work on Unix as well right? If so, simple fix here.

meet1919 commented 1 year ago

@nateraw yes I think so. you should add a parameter in the walk() function for specifying shell value, to prevent from making changes in the subprocess.py file.

meet1919 commented 1 year ago

Are there any animation settings for walk() like deforum_stable_diffusion ?

nateraw commented 1 year ago

Nope. The idea here was to use raw outputs of the model, not applying any animation settings.

If you'd like to discuss that, feel free to open a separate issue and we can. Would prefer to keep these issues focused on one topic at a time.

I am leaning towards not doing animation stuff, but I am happy to discuss and see if its something that we really want.