This repository allows you to set up a AI Horde Worker to generate or alchemize images for others
reGen
if you are a new worker and are looking to do image generation.AI-Horde-Worker
.This repo contains the original (now outdated - see above) reference implementation for a AI Horde Worker. This will turn your graphics card(s) into a worker for the AI Horde and you will receive in turn kudos which will give you priority for your own generations.
Alternatively you can become an Alchemist worker which is much more lightweight and can even run on CPU (i.e. without a GPU).
Please note that AMD card are not currently supported, but may be in the future. (Note: horde-worker-reGen has prelimanry support for AMD and if you are an AMD card and would like to help us improve support by testing it, let us know in our discord)
To run the bridge, simply follow the instructions for your own OS
If you haven't already, go to AI Horde and register an account, then store your API key somewhere secure. You will need it later in these instructions.
This will allow your worker to gather kudos for your account.
Use these instructions if you have installed git for windows.
This option is recommended as it will make keeping your repository up to date much easier.
git GUI
https://github.com/Haidra-Org/AI-Horde-Worker.git
Clone
Repository > Git Bash
. A new terminal window will open.Use these instructions if you do not have git for windows and do not want to install it. These instructions make updating the worker a bit more difficult down the line.
This assumes you have git installed
Open a bash terminal and run these commands (just copy-paste them all together)
git clone https://github.com/Haidra-Org/AI-Horde-Worker.git
cd AI-Horde-Worker
Continue with the Running instructions
The below instructions refer to running scripts horde-bridge
or update-runtime
. Depending on your OS, append .cmd
for windows, or .sh
for linux.
You can double click the provided script files below from a file explorer or run it from a terminal like bash
, git bash
or cmd
depending on your OS.
The latter option will allow you to see errors in case of a crash, so it's recommended.
If you have just installed or updated your worker code run the update-runtime
script. This will ensure the dependencies needed for your worker to run are up to date
This script can take 10-15 minutes to complete.
In order to connect to the horde with your username and a good worker name, you need to configure your horde bridge. To this end, we've developed an easy WebUI you can use
To load it, simply run bridge-webui
. It will then show you a URL you can open with your browser. Open it and it will allow you to tweak all horde options. Once you press Save Configuration
it will create a bridgeData.yaml
file with all the options you set.
Fill in at least:
You can use this UI and update your bridge settings even while your worker is running. Your worker should then pick up the new settings within 60 seconds.
You can also edit this file using a text editor. We also provide a bridgeData_template.yaml
with comments on each option which you can copy into a new bridgeData.yaml
file. This info should soon be onboarded onto the webui as well.
Start your worker, depending on which type your want.
If you want to generate Stable Diffusion images for others, run horde-bridge
.
Warning: This requires a powerful GPU. You will need a GPU with at least 6G VRAM
If you want to interrogate images for other, run horde-alchemist_bridge
. This worker is very lightweight and you can even run it with just CPU (but you'll have to adjust which forms you serve)
Warning: Currently the Alchemist worker will download images directly from the internet, as if you're visiting a webpage. If this is a concern to you, do not run this worker type. We are working on setting up a proxy to avoid that.
Remember that worker names have to be different between Stable Diffusion worker and Alchemist worker. If you want to start a different type of worker in the same install directory, ensure a new name by using the --name
command line argument.
To use multiple GPUs as with NVLINK workers, each has to start their own webui instance. For linux, you just need to limit the run to a specific card:
CUDA_VISIBLE_DEVICES=0 ./horde-bridge.sh -n "My awesome instance #1"
CUDA_VISIBLE_DEVICES=1 ./horde-bridge.sh -n "My awesome instance #2"
etc
The AI Horde workers are under constant improvement. In case there is more recent code to use follow these steps to update
First step: Shut down your worker by putting it into maintenance, and then pressing ctrl+c
Use this approach if you cloned the original repository using git clone
bash
, git bash
, cmd
, or powershell
terminal depending on your OSgit pull
Afterwards run the horde-bridge
script for your OS as usual.
Use this approach if you downloaded the git repository as a zip file and extracted it somewhere.
worker/
directory from your folderCtrl+C
together.Many models in this project use the CreativeML OpenRAIL License. Please read the full license here.
To run the Docker container, specify the required environment variables:
ghcr.io/Haidra-Org/ai-horde-worker:
Optional environment variables: