ZeroCool22

StableDiffusion-WSL

Oct 7th, 2022
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | Software | 0 0
  1. == https://github.com/ShivamShrirao/diffusers/tree/main/examples/dreambooth ==
  2.  
  3. * Make a place for downloads
  4. mkdir Downloads
  5. cd Downloads
  6.  
  7. * Download & Install Anaconda
  8. wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
  9. chmod +x ./Anaconda3-2022.05-Linux-x86_64.sh
  10. ./Anaconda3-2022.05-Linux-x86_64.sh
  11.  
  12. * Nvidia CUDA toolkit for Ubuntu WSL - https://developer.nvidia.com/cuda-downloads
  13. wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
  14. sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
  15. wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda-repo-wsl-ubuntu-11-7-local_11.7.1-1_amd64.deb
  16. sudo dpkg -i cuda-repo-wsl-ubuntu-11-7-local_11.7.1-1_amd64.deb
  17. sudo cp /var/cuda-repo-wsl-ubuntu-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
  18. sudo apt-get update
  19. sudo apt-get -y install cuda
  20.  
  21. * New shell with Anaconda & install g++
  22. bash
  23. sudo apt install build-essential
  24.  
  25. * New virtual Python environment
  26. conda update -n base -c defaults conda
  27. conda create --name diffusers python=3.9
  28. conda activate diffusers
  29.  
  30. * Make a directory for all your github downloads, then download diffusers
  31. mkdir ~/github
  32. cd ~/github
  33. git clone https://github.com/ShivamShrirao/diffusers.git
  34. cd diffusers
  35.  
  36. * Install required packages
  37. pip install .
  38. cd examples/dreambooth
  39. pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
  40. pip install -r requirements.txt
  41. pip install -U --pre triton
  42. pip install ninja bitsandbytes
  43. pip install git+https://github.com/facebookresearch/xformers@1d31a3a#egg=xformers
  44.  
  45. * Configure / login
  46. accelerate config
  47. huggingface-cli login
  48. mkdir -p training
  49. mkdir -p classes
  50. explorer.exe .
  51.  
  52. * Edit your training file and add this line to the top or reboot:
  53. export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH
  54.  
  55. * Copy your training file from your Windows desktop (or wherever you saved it):
  56. cp /mnt/c/Users/YOUR_USERNAME/Desktop/my_training.sh ./
  57. chmod +x ./my_training.sh
  58. ./my_training.sh
  59.  
  60.  
  61. * NB: If you get an error like this -
  62. 403 Client Error: Forbidden for url: https://huggingface.co/CompVis/stable-diffusion-v1-4/resolve/main/model_index.json
  63.  
  64. Then:
  65. Make sure you've visited https://huggingface.co/CompVis/stable-diffusion-v1-4 and accepted the licence!
  66. NB. If this is the very first time you've used diffusers, it's about a 6GB download
  67.  
  68. To train again next time, simply:
  69.  
  70. * Start Ubuntu, then:
  71. conda activate diffusers
  72. cd ~/github/diffusers/examples/dreambooth
  73. ./my_training.sh
  74.  
Tags: -Dreambooth
Add Comment
Please, Sign In to add comment