BinitDOX / Manga-Colorizer

Bring mangas to life!
MIT License
22 stars 3 forks source link

Had some trouble installing the self-hosting version, but now it works and it is awesome! #6

Closed vatavian closed 2 months ago

vatavian commented 6 months ago

New instructions for installing the backend on your own computer (self-hosting):

Clone the repository or download as .zip and extract. Download the generator weights from https://drive.google.com/file/d/1qmxUEKADkEM4iYLp1fpPLLKnfZ6tcF-t/view?usp=sharing and move it into the Backend/networks folder.

In the Backend folder, open a command prompt, and run:

pip install -r requirements.txt

See the instructions in the comments in Backend/requirements.txt to install PyTorch, then continue below.

Run the following two commands in the Backend folder to generate your own self-signed key (needed for using https). You can safely just press Enter to accept the default value for all questions:

openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr openssl x509 -req -days 730 -in server.csr -signkey server.key -out server.crt

Now you have a choice to make between the original batch backend and the new streaming backend.

  1. The original backend works with Manganelo and colors a chapter as a batch. It is used by Frontend-Chrome and Frontend-Firefox. If you are going to use this and you do not have a GPU, edit app.py and set self.gpu = False (~Line 75). Launch the original backend with the command: python app.py

  2. The new backend works with more sites and streams one image at a time between the front and back ends. It is used by Frontend-Chrome-AnySite, Frontend-Firefox-AnySite, and Frontend-Safari. Launch the streaming backend with the command: python app-stream.py

Whichever backend you started should run on localhost (https://127.0.0.1:5000/) and Private IP (https://x.x.x.x:5000/)

You will need to enter the Private IP into whichever frontend you use. You should be able to use a frontend on the same computer or on any device on the same local network.

After setting this up for the first time, you will only need to do the last step of opening a command prompt in the Backend folder and using the python command to start the backend each time you want to use it. Make sure your frontend gets the right Private IP each time! Many home routers will give your computer a slightly different private IP address each time it restarts.

BinitDOX commented 6 months ago

Thank you so much for documenting these issues! It will be incredibly helpful for others following the self-hosting instructions.

I personally only use the Kaggle hosting, so I can close my PC after hosting it and use it on phone. Therefore, I never updated this self-hosting method. I'll surely add this issue link in the readme.

I'm GLaD you like it! The main colorizer model was created/trained by: https://github.com/qweasdd/manga-colorization-v2

Chiwebow commented 2 months ago

Sorry, but I try to run the openssl command and I get this? Any way I can fix it? image

Chiwebow commented 2 months ago

I fixed it but now it says "Numpy is not available", any idea how to fix it?

vatavian commented 2 months ago

It looks like Chiwebow fixed the problem they were having. It probably had something to do with the step: "See the instructions in the comments in Backend/requirements.txt to install PyTorch"