Git Product home page Git Product logo

miner-release's Introduction

Heurist Miner

For GPU Ninjas: You can skip any of these steps if you already have the toolkits installed.

  • If you have installed Python 3.x, you possibly don't need to install Miniconda and latest Python again if you can handle the dependency installation in Step 5 and 7, but it's recommended that you still go through Step 2 and 3 to manage Python dependencies with Conda environment.
  • If you have installed CUDA before, you need to install the matching PyTorch version in Step 5 to work with your CUDA version.

This is a preview version of testnet mining program. You may meet some unexpected problems when setting it up. Heurist team can help answer your questions in Discord #miner-chat channel

Configure Miner ID(s)

  1. Create a .env File: Navigate to the root directory of your miner-release folder. Here, create a new file named .env. This file will hold the unique identifiers (miner IDs) for your mining operation. You can find the example .env.example

  2. Define Unique Miner IDs: In the .env file, you will assign a unique Ethereum wallet address as a miner ID for each of your GPUs. These Ethereum addresses will serve as the miner IDs, which are crucial for tracking your contributions and ensuring you receive rewards accurately.

    Use the following format to define each miner ID in the .env file, ensuring that each Ethereum address starts with 0x and is unique to each GPU:

    MINER_ID_0=0xYourFirstWalletAddressHere
    MINER_ID_1=0xYourSecondWalletAddressHere
    

    Continue this pattern for as many GPUs as you have, assigning a unique wallet address to each one. For instance, if you have three GPUs, you would define MINER_ID_0, MINER_ID_1, and MINER_ID_2, each with a different Ethereum wallet address.

  3. Configure Multiple GPUs: If your mining setup includes multiple GPUs, ensure that you've created a line in the .env file for each one, following the pattern described above. If you use the same miner_id for multiple GPUs, the protocol will recognize you as one GPU. Make sure you set unique miner_id for each GPU to receive rewards correctly.

Windows Setup Guide

Step 1. (Optional) Update GPU drivers

  1. Go to the NVIDIA Driver Downloads page.

  2. Select your GPU model and OS.

  3. Download and install the latest driver. Restart your PC if necessary.

Step 2. Install Miniconda

  1. Download the Miniconda Installer.
  • Visit the Miniconda Downloads page.
  • Get the latest Windows 64-bit version for Python 3.11. conda activate pytorch-gpu-python-3-10.

Step 3. Create a Conda Environment

  1. Open a command prompt (Win + X > “Command Prompt”).

  2. Create the Environment:

  • Type conda create --name gpu-3-11 python=3.11 (or choose your Python version).
  • Press Enter and wait for the process to finish.
  1. Activate the Environment
  • Type conda activate gpu-3-11

Step 4: Install CUDA Toolkit

  1. Download and Install CUDA:

Step 5: Install PyTorch with GPU Support

  1. Go to the PyTorch Install Page.
  • Set Your Preferences: Choose PyTorch, Conda, CUDA 12.1
  • Install PyTorch: Copy the generated command (like conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia). Paste it in the Command Prompt and hit Enter.

Step 6: Download Miner Scripts

  1. Run git clone https://github.com/heurist-network/miner-release in command prompt. Or Click "Code -> Download ZIP" in this Github repo - miner-release to download miner scripts.

Step 7: Install Dependencies from requirements.txt

  1. Open Your Command Prompt
  • Make sure you're still in your Conda environment. If not, activate it again with conda activate gpu-3-11
  1. Navigate to miner-release folder
  • Use the cd command to change directories to where requirements.txt is located. For example, cd C:\Users\YourUsername\Documents\miner-release.
  1. Install Dependencies:
  • Run the command pip install -r requirements.txt. This command tells pip (Python's package installer) to install all the packages listed in your requirements.txt file.

Step 8. Configuring Your Miner ID with a .env File

See the top of this guide.

Step 9. Run the miner program

  1. Run python3 sd-miner-v0.0.x.py (select the latest version of file) in Conda environment command prompt.

  2. Type yes when the program prompts you to download model files. It will take a while to download all models. The program will start processing automatically once it completes downloading.

Step 10. (Optional) Enhancing Your Mining Experience with CLI Options

To optimize and customize your mining operations, you can utilize the following command line interface (CLI) options when starting the miner:

--log-level

Control the verbosity of the miner's log messages by setting the log level. Available options are DEBUG, INFO (default), WARNING, ERROR, and CRITICAL.

--auto-confirm

Automate the download confirmation process, especially useful in automated setups. Use yes to auto-confirm or stick with no (default) for manual confirmation.

Usage Example:

python sd-miner.py --log-level DEBUG --auto-confirm yes

Congratulations! 🌟 You're now set to serve image generation requests. You don't need to keep it up 24/7. Feel free to close the program whenever you need your GPU like playing video games or streaming videos.

Linux Setup Guide

This guide assumes you're familiar with the terminal and basic Linux commands. Most steps are similar to the Windows setup, with adjustments for Linux-specific commands and environments.

  • Python Installation: If Python 3.x is already installed, you can skip the Miniconda installation. However, using Miniconda or Conda to manage dependencies is still recommended.
  • CUDA: If CUDA is previously installed, ensure the PyTorch installation matches your CUDA version.

Step 1. Update GPU drivers (Optional)

  • Use your Linux distribution's package manager or download drivers directly from the NVIDIA website. For Ubuntu, you might use commands like sudo apt update and sudo ubuntu-drivers autoinstall.

Step 2. Install Miniconda or Conda (Optional)

  • Download the Miniconda installer for Linux from the Miniconda Downloads page.
  • Use the command line to run the installer.

Step 3. Create a Conda Environment

  • Open a terminal.
  • Create a new environment with conda create --name gpu-3-11 python=3.11.
  • Activate the environment using conda activate gpu-3-11.

Step 4: Install CUDA Toolkit

  • Install CUDA from the CUDA Toolkit download page appropriate for your Linux distribution. Follow the installation instructions provided on the NVIDIA website.

Step 5: Install PyTorch with GPU Support

  • Visit the PyTorch installation guide, set preferences for Linux, Conda, and the appropriate CUDA version.
  • Use the provided command in the page, such as conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia, in your terminal.

Step 6: Download Miner Scripts

  • Use Git to clone the miner scripts repository with git clone https://github.com/heurist-network/miner-release. Alternatively, download the ZIP from the GitHub page and extract it.

Step 7: Install Dependencies from requirements.txt

  • Ensure you're in the Conda environment (conda activate gpu-3-11).
  • Navigate to the miner-release directory.
  • Install dependencies with pip install -r requirements.txt.

Step 8. Configure your Miner ID

Use .env in the miner-release folder to set a unique miner_id for each GPU. (See the top of this guide. This is very important for tracking your contribution!)

Step 9. Run the miner program

  • Execute the miner script with python3 sd-miner-v0.0.x.py (select the latest version) in your terminal. Agree to download model files when prompted.

Additional Linux-Specific Tips:

  • Use screen or tmux to keep the miner running in the background, especially when connected via SSH.

Follow these steps to set up the Heurist Miner on a Linux system, adjusting commands and procedures as necessary for your specific Linux distribution and setup.

The updated model now supports Long Prompt Weighting(LPW) Stable Diffusion

Features of this custom pipeline:

  • Input a prompt without the 77 token length limit.
  • Includes tx2img, img2img, and inpainting pipelines.
  • Emphasize/weigh part of your prompt with parentheses as so: a baby deer with (big eyes)
  • De-emphasize part of your prompt as so: a [baby] deer with big eyes
  • Precisely weigh part of your prompt as so: a baby deer with (big eyes:1.3)

Prompt weighting equivalents:

  • a baby deer with == (a baby deer with:1.0)
  • (big eyes) == (big eyes:1.1)
  • ((big eyes)) == (big eyes:1.21)
  • [big eyes] == (big eyes:0.91)

miner-release's People

Contributors

entrosanity avatar dereek69 avatar ernest22 avatar volpato30 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.