s9roll7 / ebsynth_utility

AUTOMATIC1111 UI extension for creating videos using img2img and ebsynth.
1.24k stars 127 forks source link

Loader not defined #25

Open Pedroman1 opened 1 year ago

Pedroman1 commented 1 year ago

Im getting this error i did a fresh clone of everything including automatic1111 as well as ffmpeg.

stage1

Skip frame extraction Settings -> Mode=base, Device=cuda:0, Torchscript=disabled Traceback (most recent call last): File "C:\Users\Pete\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Pete\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "E:\01_AI\stable-diffusion-webui\venv\Scripts\transparent-background.exe__main__.py", line 7, in File "E:\01_AI\stable-diffusion-webui\venv\lib\site-packages\transparent_background\Remover.py", line 181, in console loader = eval(_format + 'Loader')(args.source) File "", line 1, in NameError: name 'Loader' is not defined mask created

completed.

vibris07 commented 1 year ago

Im getting the same error

s9roll7 commented 1 year ago

Did you add any files in the "video_frame" yourself?

s9roll7 commented 1 year ago

I checked the source code of "transparent_background" and it seems that the error occurs when there is an image and a video in the specified directory at the same time.

Pedroman1 commented 1 year ago

@s9roll7 hey thanks for the quick reply. I wish I had a video and a photo in the folder but I just made a fresh folder for the project and then referenced a short clip of a video. I tried both .mov and .mp4 and in the clip directory it is just the single clip. Ive played around and tried folders different locations thinking maybe the string for the directory was too long or something similar.

I dont know if it helps but in the output which is not in the cmd but within the GUI it just says stage1

Skip frame extraction mask created

completed.

s9roll7 commented 1 year ago

Can you post the results using the following command in the project dir? dir /s

Pedroman1 commented 1 year ago

@s9roll7

image

Im sorry I am new to all this python stuff and I'm sure its some mistake on my end. One thing I can think of that maybe could mess it up is I start my web ui user with this:

@echo off

set PYTHON= set GIT= set VENV_DIR= set COMMANDLINE_ARGS=--opt-sdp-no-mem-attention --ckpt-dir 'E:\3_CHECKPOINTS' --disable-safe-unpickle set TORCH_COMMAND=pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu118

call webui.bat

I have no programming experience but looking at the files my error was referencing maybe by having checkpoints in a different place could screw it up? I also reinstalled python so I feel like only my webui user.bat is probably the only outlier?

s9roll7 commented 1 year ago

Delete the video_frame and video_mask directories and try again

mrgamezy commented 1 year ago

Had a very similar problem but, resolved it by installing ffmpeg using chocolatey. (also moved the video out of the project folder!)

Pedroman1 commented 1 year ago

Well I did chocolatey and moved video from the same directory and this time it worked so not sure which one it was but thank u all

Gerry-Clark commented 1 year ago

I reinstalled with choclatey, moved directory to c:\ , renamed with no spaces. Still getting "Loader not defined". Any other suggestions welcome. I'm not a coder so I'm really floundering with this but I want to keep trying as I think this is the missing link for the kind of hybrid animation I want to create.

s9roll7 commented 1 year ago

What os are you using? Do you have ffmpeg installed? What happens when you type ffmpeg at the command prompt? The reason you are getting "Loader not defined" is because either you are not outputting frames to video_frame, or you have video files in video_frame. In addition, the implementation skips the frame output process if the video_frame directory already exists to avoid unnecessary frame output each time. If there is an empty video_frame directory, delete it.

Gerry-Clark commented 1 year ago

Thanks for the reply s9roll7. While I was preparing my reply to you and methodically going through the steps I normally take, I created a new directory for my input video in c:. After dragging and dropping my video I noticed that the Original Movie Path was pointing to a temp directory so I changed that to the directory I had created. I now have stage 1 working, so at least one of those steps was useful. I'll feed back here when I find out what I did right.

Gerry-Clark commented 1 year ago

Here's what I've discovered. Project directory and Original Movie Path must be in locations without spaces. I used c:\ebsynthout and c:\ebsynthin In addition, there must be no spaces in the video file name. If you've used the video icon to select the input video and you get a temp path then that works ok. Previous tip about keeping the Project directory clear before generating is good advice.

A batch utility at Stage 6 to run multiple .ebs files would be really useful. Either that or all frames get bundled into a single .ebs but I assume that's something for the Ebsynth developers to address.

I hope this helps anyone else who struggled with the first stage.

screan commented 1 year ago

same for me now. i had to remove any characters from the path name. so no underscores _ or spaces.

vibris07 commented 1 year ago

stage1

Skip frame extraction Settings -> Mode=base, Device=cuda:0, Torchscript=disabled Traceback (most recent call last): File "D:\01_stable-diffusion\python\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\01_stable-diffusion\python\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\01_stable-diffusion\venv\Scripts\transparent-background.exe__main__.py", line 7, in File "D:\01_stable-diffusion\venv\lib\site-packages\transparent_background\Remover.py", line 181, in console loader = eval(_format + 'Loader')(args.source) File "", line 1, in NameError: name 'Loader' is not defined mask created

completed.

I followed all the steps in the previous posts. I reinstalled with chocolatey, moved directory to c:\ , renamed with no spaces. I even reinstalled stable-diffusion.) No result. Apparently there is still a problem with installation (or specifying download path) of ffmpeg.

Note that in other extensions on the same computer (DEFORUM,ModelScope) ffmpeg works without problems. But in all these extensions user can specify path to load ffmpeg, but in ebsynth_utility it is not. Maybe here is the cause of the error?

s9roll7 commented 1 year ago

Delete the video_frame and video_mask directories and try again

vibris07 commented 1 year ago

I have done this). I do this before every generation. Same error.

NickPittas commented 1 year ago

Get ffpmeg's directory into your PATH. In windows add the ffmpeg/bin folder to your system environment variables PATH

QiYoe commented 1 year ago

For my mac m1, do the following:

  1. brew install ffmpeg(takes a long time)
  2. vi ~/.zshrc
  3. Add the line to .zshrc file: export PATH=/usr/local/ffmpeg/bin:$PATH After :wq Save and exit
  4. source ~/.zshrc
ktronfabi commented 1 year ago

Get ffpmeg's directory into your PATH. In windows add the ffmpeg/bin folder to your system environment variables PATH

im trying to do this but there is no bin folder

image

ALANXIAORUI commented 1 year ago

same problem ,this is my error message: video:2950046kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown frame extracted Fatal error in launcher: Unable to create process using '"E:\AI??\stable-diffusion-webui-master\venv\Scripts\python.exe" "E:\AI??\stable-diffusion-webui\venv\Scripts\transparent-background.exe" --source D:\output\jinitaimei\video_frame --dest D:\output\jinitaimei\video_mask --type map': ???????????

liam1125 commented 1 year ago

[Problem Already Solved] I have the same problem. But I solved with the following step:

1) Project directory and Original Movie Path must keep a role: "without spaces and without &" . For example "F:\01_Video_Editing\dir01" replace "F:\01-Video&Editing\dir 01"

2) Do not use put video into the Original Movie Path, relpace it. After dragging and dropping video that the Original Movie Path was pointing to a temp directory. so we change the path from "C:\Users\Administrator\AppData\Local\Temp\5c5XXXX.mp4" to "F:\01_Video_Editing\test01.mp4" .

3) make sure the project directory is empty.

aratamatech commented 1 year ago
brew update
brew upgrade

In the mac environment, it was resolved with the above flow. For your reference.

vezleyj commented 1 year ago

Delete the video_frame and video_mask directories and try again

appriciate!