Locally Train Stable Diffusion with Dreambooth using WSL Ubuntu

Channel:
Subscribers:
2,810
Published on ● Video Link: https://www.youtube.com/watch?v=bMmehBxbGtQ



Duration: 17:47
1,672 views
27


Locally Train Stable Diffusion with Dreambooth using WSL Ubuntu

If you are able to use Deepspeed, this may work on 8gb-12gb cards, but I haven't been able to get below 10gb personally.

Command list:

wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
chmod +x ./Anaconda3-2022.05-Linux-x86_64.sh
./Anaconda3-2022.05-Linux-x86_64.sh
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo cp /var/cuda-repo-wsl-ubuntu-11-7-local/cuda-96193861-keyring.gpg /usr/share/keyrings/
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
sudo dpkg -i cuda-repo-wsl-ubuntu-11-7-local_11.7.1-1_amd64.deb

sudo cp /var/cuda-repo-wsl-ubuntu-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
OR:
sudo cp /var/cuda-repo-wsl-ubuntu-11-7-local/cuda-96193861-keyring.gpg /usr/share/keyrings/cuda-archive-keyring.gpg

sudo apt-get update
sudo apt-get -y install cuda

Open a windows shell and type wsl --shutdown

git clone https://github.com/ShivamShrirao/diffusers.git
cd diffusers
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
pip install -r requirements.txt
pip install -U --pre triton
pip install ninja bitsandbytes
pip install .
cd examples/dreambooth
pip install git+https://github.com/facebookresearch/xformers@1d31a3a#egg=xformers
accelerate config
huggingface-cli login


python convert_diffusers_to_original_stable_diffusion.py --model_path /home/MODEL-TO-CONVERT --checkpoint_path /OUTPUT PATH

Note: Windows drives mounted to /mnt/[drive letter]

wsl kernel updates
https://www.catalog.update.microsoft.com/Search.aspx?q=wsl%20kernel

Reddit Dreambooth guide by ThereforeGames
https://www.reddit.com/r/StableDiffusion/comments/ydip3s/guide_dreambooth_training_with_shivamshriraos/

Shivam Shiraro's Diffuser's Repo
https://github.com/ShivamShrirao/diffusers




Other Videos By NanoNomad


2023-02-24Train or Fine Tune VITS on (theoretically) Any Language | Train Multi-Speaker Model | Train YourTTS
2023-02-12Even more Voice Cloning | Train a Multi-Speaker VITS model using Google Colab and a Custom Dataset
2023-02-04Updated | Near-Automated Voice Cloning | Whisper STT + Coqui TTS | Fine Tune a VITS Model on Colab
2023-01-30YourTTS Training Discussion | Experiences, Multistage Training, Demos, Prior Training Preservation
2023-01-27Updated | Fine-Tuning YourTTS with Automated STT Datasets on Google Colab for AI Voice Cloning
2023-01-13Fine-Tune YourTTS with Near-Automated Datasets on Google Colab for AI Voice Cloning
2022-12-22Near-Automated Voice Cloning | Whisper STT + Coqui TTS | Fine Tune a VITS Model on Colab or Linux
2022-12-09Dreambooth and Fine Tuning for Stable Diffusion 1.5 and 2 with this Versatile Script
2022-11-30If Bill Gates could rap? AI Synthesized Voice, AI Upsampled Video | Deltron 3030's Virus
2022-11-14Training Stable Diffusion Dreambooth on Multiple Subjects for Combined Image Generation
2022-10-31Locally Train Stable Diffusion with Dreambooth using WSL Ubuntu
2022-10-25Animated Stable Diffusion and Synthesized Voice Demo with Facial Movements
2022-10-24Stable Diffusion Image to Video, Synthesized Lauretta Young 1930s voice, Wav2Lip Demo
2022-10-16Animate Images using AI with Frame Interpolation for Large Motion
2022-10-14Animated Stable Diffusion Images using Google's FILM Frame Interpolation for Large Motion demo
2022-10-07Training Textual Inversion for Stable Diffusion | Customizable AI Image Generation
2022-09-26How to Download All Styles and Objects from the Stable Diffusion Concepts Library | AI Images
2022-09-05AI Images | Installing Stable Diffusion and the Automatic1111 WebUI using Conda on Windows 10
2022-09-04AI Image Generation with Stable Diffusion Part 2 | Img2Img Transformations, Masking, Upscaling
2022-09-01AI Image Generation with Stable Diffusion | Part 1
2022-08-28Johnny Cash Delivers The Great Dictator Speech | AI Voice Demo VITS Model with Stable Diffusion art



Tags:
Stable Diffusion
dreambooth
ai art
text2image
artificial intelligence