Step-by-Step Instructions
- System Update and Package Installation:
- Update your system to ensure all packages are up to date.
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3 python3-pip python-is-python3
- Clone the Repository:
git clone <https://github.com/NicheTensor/NicheImage>
cd NicheImage
- Create and activate python virtual environment:
python -m venv main_env
source main_env/bin/activate
- Install requirements:
pip install -e .
pip uninstall uvloop -y
git submodule update --init --recursive
. generation_models/custom_pipelines/scripts/download_antelopev2.sh
# Pre-requisites for ComfyUI: Sticker Maker and Face To Many
. generation_models/comfyui_helper/install_comfyui.sh
# Pre-requisites for ComfyUI: Face To Many
. generation_models/comfyui_helper/scripts/download_antelopev2.sh
- Start the endpoint
source main_env/bin/activate
pm2 start python --name "miner_endpoint" -- -m services.miner_endpoint.app \\
--model_name FaceToMany \\
--num_replicas X \\ # num_replicas should be set to the total number of GPUs available
--num_gpus Y \\ # num_replicas should be set to 1 (default)
--port 10006 # default port
- Start the miner
pm2 start python --name "miner" \\
-- \\
-m neurons.miner.miner \\
--netuid 23 \\
--wallet.name <wallet_name> --wallet.hotkey <wallet_hotkey> \\
--subtensor.network <network> \\ # default is finney
--axon.port <your_public_port> \\
--generate_endpoint [<http://127.0.0.1:10006/generate>](<http://127.0.0.1:10006/generate>) \\ # change if you use different port or host
--info_endpoint [<http://127.0.0.1:10006/info>](<http://127.0.0.1:10006/info>) \\ # change if you use different port or host
--miner.total_volume <your-generation-volume> # default is 40. Change based on your model timeout value and GPU capacity
--miner.max_concurrent_requests <your-max-concurrent-requests> # default is 4. Change based on your model timeout value and GPU capacity
- Important notes:
miner.total_volume <your-generation-volume>
refers to the total number of requests your miner can process
- This is calculated by the following formula: total_volume = total_available_gpus * 600_seconds / generation_time_per_image_or_text
- Ex: 2 * 600 / 8 = 150
- In this case the total volume would be 150 requests
- Important: Because of the balance between speed_penalty and volume_reward, calculating miner total volume is highly system and situtation dependent.
miner.max_concurrent_requests <your-max-concurrent-requests>
refers to the number of requests that can be processed in parallel.
- This is calculated by the following formula: max_concurrent_requests = num_gpus * timeout_limit_for_model / generation_time_per_image_or_text
- 2 * 12 / 8 = 3
- In this case the total number of concurrent requests would be 3:
- 2 GPUs, 12s timeout and 8s per image generation.