This is a repository for AIPG Omniworker. It's a tool for easy setup and management of single or multiple Image and/or Text workers in AIPG Network.
This is the fastest and simplest way to start running the Omniworker. However, it may not work on every system.
- Go to Releases and download the latest AIPG-Omniworker-Windows-Installer.exe
- Run the installer. You might need to restart your computer and rerun the installer when prompted.
- http://localhost:7870/ should open automatically. Follow the instructions there.
Running the installer again will try to update Omniworker to the newest version and start it up again.
If the Installer method fails for you, this is a safer router, but it requires manually installing a few things.
- Install Docker if not installed already.
- Install CUDA Toolkit if not installed already.
- Run this command:
(docker rm -f aipg-omniworker || ver > nul) && docker pull dex3r/aipg-omniworker && docker run -d -p 7870:8080 --gpus "all" --shm-size 8g --mount source=aipg-omniworker-volume,target=/persistent --restart=unless-stopped --name aipg-omniworker dex3r/aipg-omniworker
- Go to http://localhost:7870/ and follow the instructions
- Install Docker CE (not Docker Desktop nor Snap Docker) if not installed already.
- Install NVIDIA Container Toolkit if not installed already.
- Run this command:
sudo -- sh -c "docker rm -f aipg-omniworker ; sudo docker pull dex3r/aipg-omniworker ; sudo docker run -d -p 7870:8080 --gpus 'all' --shm-size 8g --mount source=aipg-omniworker-volume,target=/persistent --restart=unless-stopped --name aipg-omniworker dex3r/aipg-omniworker"
- Go to http://localhost:7870/ and follow the instructions
- Install Docker and Nvidia software from the steps above.
- Clone this repository.
- Clone submodules:
git submodule init
andgit submodule update
- Run the command from #Development section below.
This is the recommended configuration method. Just go to http://localhost:7870/ and follow the instructions.
Optionally, you can configure workers by modifying the config files directly and providing environmental variables. This is much harder than using the web frontend.
Variables:
GRID_API_KEY - your API key from https://api.aipowergrid.io/register
WORKER_NAME - you unique worker name
e.g.
docker run -d -p 7870:8080 --gpus "all" --shm-size 8g --mount source=aipg-omniworker-volume,target=/persistent --env GRID_API_KEY=YOUR_GRID_KEY_HERE --env WORKER_NAME=YOUR_WORKER_NAME_HERE --name aipg-omniworker dex3r/aipg-omniworker
Configuration files can be found in a docker volume.
- Run the image for a few seconds.
- Find Docker volume named
aipg-omniworker-volume
. - Modify the following files in the
config/
directory:userConfig.yaml
,instanceConfig_0.yaml
. Optionally also modify:bridgeData.yaml
,imageBridgeData.yaml
,textWorkerConfig.yaml
. - Duplicate
instanceConfig_0.yaml
to match the desired number of workers, renaming files with increasing N (N >= 0) as this template:instanceConfig_N.yaml
. - Inside each
instanceConfig_N.yaml
setAutoStartWorker
totrue
. - Run the container.
- Works on Windows with WSL Docker
- Works on Linux
- Basic Web Control Panel
- Ability to start from CLI without interacting with Web Control Panel
- Saving config, downloaded models and logs between containers in Docker Volume
- Watchdog to look for worker process crash
- Watchdog to check worker health
- Periodic auto-restart
- Image worker support
- Text worker support
- Automatic worker selection based on grid image/worker balance
- Automatic worker selection based on centralized decision (call to the Horde API)
- Automatic worker selection based on grid image/worker needs (how long is the image/text jobs queue)
- Multiple GPU support
- CUDA not installed detection and instructions
- Text worker/Aphrodide/Image worker/API error detection
- Windows EXE installer with automatic Docker and CUDA installation
- Worker stats
- Worker stats graphs
- Recommended models option, where the Horde API decides what image/text models to run
Use this command to quickly build from source and run the image. Output will be logged to console and the container will be stopped and removed after the command is stopped (e.g. CTRL+C). Don't forget to fill the missing variables YOUR_GRID_KEY_HERE
and YOUR_WORKER_NAME_HERE
.
docker build -t aipg-dotnet-worker . && docker run --rm --mount source=aipg-omniworker-volume,target=/persistent -p 7870:8080 --gpus "all" --shm-size 8g --env GRID_API_KEY=YOUR_GRID_KEY_HERE --env WORKER_NAME=YOUR_WORKER_NAME_HERE --name aipg-omniworker aipg-dotnet-worker