Installation Instructions (Docker) (Advanced) - skier233/nsfw_ai_model_server GitHub Wiki
Prerequisites
-
For GPU support, ensure you have the NVIDIA Container Toolkit installed. Follow the steps below to install it:
-
Ubuntu:
sudo apt-get update sudo apt-get install -y nvidia-container-toolkit sudo systemctl restart docker -
Windows:
Follow the instructions here to set up the GPU support for Windows.
-
Building the Docker Container
-
Navigate to the directory where you unzipped the release.
-
Build the Docker image using the following command:
docker build -t ai_model_server . -
Edit the docker-compose.yml by adding the path to your Cove media at the bottom:
device: <your-cove-media> -
Download any models you want to use from the models page and unzip and copy the contents (the config and models folders) into the AI Server folder created in the previous step. Then add the model name to the config/active_ai.yaml file to make it active.
-
Start the docker container using the following command:
docker compose up -
(If using a Patreon exclusive model) The first time you run the server, it'll give you a link to download a license. Save the license file to your models folder.
-
The server will expect paths in the format of
/media(the second part of the first line involumesin the docker-compose file). If you send paths to the server that are paths from the host operating system it will not be able to see them. If you're using the official Cove extension, you can use the path mapping config in settings->Extensions->AI to map the paths from Cove that are sent to the server. If Cove is also running in a docker container then you can use the same path instead of/mediaas in the Cove container and then mutation will not be needed. If Cove is not running in a docker container then you'll want to add each path you defined above to the path mapping.
Docker Updating Instructions
To update from a previous version run (windows) .\install\update.ps1 or (linux) source .\install\update.sh.
Then, rebuild the docker container again using step 2 above.