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

Feature(?) Enhancement/Request: Post-processing pipeline for Linux systems #20

Closed
ICYDev opened this issue Mar 30, 2023 · 15 comments
Closed
Labels
good first issue Good for newcomers

Comments

@ICYDev
Copy link

ICYDev commented Mar 30, 2023

The current cmd scripts for the smoother video generation only works for Windows machine (as far as I can tell), All the tools involved for the process does seem to also be available for Linux (and Mac), thus it should in theory be possible to adapt the scripts to work for the other OS.

@Kahsolt
Copy link
Owner

Kahsolt commented Mar 31, 2023

I do not have a Linux distro to test shell scripts, but I added a GUI script and might be a help.

postprocessor-gui

However, you still need to manually install and set up the tools folder, since that difference Linux distros differs in evil details about their software store and filesystem hierarchy ;)

@ICYDev
Copy link
Author

ICYDev commented Mar 31, 2023

Looking into manually installing the tools right now, but I have just noticed that, in the instructions, you talked about a file 'tools/README.txt' which supposedly includes information about the expected file structure in the tools folder, but the readme file stated does not exist anywhere, and the file is never pushed on any of the commits.

Kahsolt added a commit that referenced this issue Apr 1, 2023
@Kahsolt
Copy link
Owner

Kahsolt commented Apr 1, 2023

Many many thanks for your notice that I found it was excluded due to typo in .gitignore 😥

@ICYDev
Copy link
Author

ICYDev commented Apr 1, 2023

Wonderful, I do have a windows machine so I can actually just use that instead for the pipeline. I will slowly attempt to see if I can get it working on Linux, though I am not too hopeful since I do see some commands in the python script that likely won't run on Linux.
I plan on documenting it and report back slowly. For now, I do see that you might have missed the step of installing 'busybox' in the manual instruction.

@Kahsolt
Copy link
Owner

Kahsolt commented Apr 1, 2023

Thanks for any reports~
And, that busybox is not needed if you manually install tools (and not even needed if you run on Linux).
But on windows, busybox is necessary for automatic file downloading (curl) and uncompressing (unzip).

@ICYDev
Copy link
Author

ICYDev commented Apr 2, 2023

Manually downloaded only necessary files from this repo and tried to install the tool with the script.
Does not work, keeps complaining about some security error no matter how many times I tried, so I manually installed the required components and tried running the script by dragging the folder over.
Installed everything, ran cmd script, script complains about not finding busybox and errors out on probably line 108 '%BBOX_BIN% sleep %WAIT_BEFORE_START%'. Grabbing busybox fixes that, but if it's not needed then this would clearly be a bug.

@Kahsolt
Copy link
Owner

Kahsolt commented Apr 2, 2023

Oh, forgot, busybox is also used when %WAIT_BEFORE_START% need to sleep 😥
That tkinter GUI does not run on your machine? Could you show me the "some security error" screenshots?

@ICYDev
Copy link
Author

ICYDev commented Apr 2, 2023

I haven't tried the tkiner GUI yet since I think it would be better if I give it it's own python venv with the necessary modules. So I would have to spend a bit of time to set that up and I'm lazy.

The installation error is as follows
image

@Kahsolt
Copy link
Owner

Kahsolt commented Apr 2, 2023

Fine... curl failed to download via https:// due to some SSL certificate problems.
But the tkinter GUI does not rely on any third-party libraries, any python env will do, and should be more easy to startup with than the cmd script.

@ICYDev
Copy link
Author

ICYDev commented Apr 2, 2023

Will test it out, I was just planning to also write down what extra modules needs to be installed into the python environment and list them out to be documented or sth.

@ICYDev
Copy link
Author

ICYDev commented Apr 2, 2023

On Ubuntu, using a clean (I believe) python venv to run the postprocessor.py, the script would complaining about the not having following modules:

No module named '*' -> command to run to solve the issue
psutil -> pip install psutil
PIL.<sth> -> pip install Pillow
tkinter -> sudo apt install python3-tk (likely different for windows and mac, and probably would work fine if tk is already installed on the system by some other program or sth)

@Kahsolt
Copy link
Owner

Kahsolt commented Apr 2, 2023

Good, I will add them to requirements.txt.
I used think psutil and PIL are python core lib... 😶
but tkinter should be, though it may need a backend on Linux.

@ICYDev
Copy link
Author

ICYDev commented Apr 2, 2023

The GUI also doesn't work fully, below are errors I have discovered:

  • The image frame slider shows the image out of order, jumping all over the place.

  • Trying to change the travel root folder would give the following error after picking a directory from the directory picker window:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
    return self.func(*args)
  File "/path/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/postprocessor.py", line 287, in open_
    dps = [dp for dp in root_dp.iterdir() if dp.is_dir()]
AttributeError: 'str' object has no attribute 'iterdir'
  • ffmpeg fails to run, error as follows:
[image2 @ 0x55b168cca800] Could find no file with path '/path/stable-diffusion-webui/outputs/txt2img-images/prompt_travel/00000/rife\%08d.png' and index in the range 0-4
/path/stable-diffusion-webui/outputs/txt2img-images/prompt_travel/00000/rife\%08d.png: No such file or directory
  • hitting the 'ok' and opening the result directory would show this error:
Traceback (most recent call last):
  File "/path/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/postprocessor.py", line 382, in run_tasks
    if r: os.startfile(base_dp)
AttributeError: module 'os' has no attribute 'startfile'

note for documentation: [on ubuntu], the executables(realesrgan and rife) need to have their permission set to allow execution otherwise it won't work either, ffmpeg is installed by 'apt install ffmpeg' and don't need to be in the 'tools' folder to work.

Kahsolt added a commit that referenced this issue Apr 2, 2023
@Kahsolt
Copy link
Owner

Kahsolt commented Apr 2, 2023

  1. directory listing order seems to depend on OS, now forcely sorted by filename 🤔
  2. bug, fixed
  3. path sep bug, should been fixed
  4. linux has no os.startfile, fixed by another approach
  5. notes added in README.md

Really appreciate your patience~ 🤗

Kahsolt added a commit that referenced this issue Apr 2, 2023
@ICYDev
Copy link
Author

ICYDev commented Apr 3, 2023

No, thank you for your hard work, you're the one actually fixing all the problems.
The python program does indeed work fine now and the document seem much more helpful.
Minor complaint would be that the program would put the embryo.png in as the final image for the video if it's left in the folder, but otherwise this issue can be closed.

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

No branches or pull requests

2 participants