how to run locally stable diffusion

Опубликовано: 01 Январь 1970
на канале: Heikki Koivisto
359
1

Here's open source tool to run our local computer text-to-image generation called stable diffusion. On this video I configure Webgui for stable diffusion and install deforum extension too.

Commands:
Update package lists
sudo apt update

Purge existing Nvidia drivers (optional)
sudo apt purge nvidia

List available drivers for your GPU
ubuntu-drivers list

Install Nvidia driver (replace nvidia-driver-530 with the appropriate driver version)
sudo apt install nvidia-driver-530

Download CUDA repository pin
wget https://developer.download.nvidia.com...
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600

Download CUDA repository package
wget https://developer.download.nvidia.com...
sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb

Copy CUDA keyring
sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/

Update package lists
sudo apt-get update

Install CUDA
sudo apt-get -y install cuda

Check Nvidia driver and CUDA installation
nvidia-smi


Install necessary dependencies - python need for webgui
sudo apt install python3 python3-pip python3-virtualenv wget git

Download and install Miniconda
wget https://repo.anaconda.com/miniconda/M...
chmod +x Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh



Create a Conda environment for Stable Diffusion
conda create --name sdwebui python=3.10.6

Activate the Conda environment
conda activate sdwebui

Clone the Stable Diffusion repository
cd ~
git clone https://github.com/AUTOMATIC1111/stab...

Download the pre-trained model (replace with the correct download link)
wget https://huggingface.co/andite/anythin...
mv /home/user/anything-v4.5-pruned.ckpt ~/stable-diffusion-webui/models/Stable-diffusion/

Activate the Conda environment
conda activate sdwebui

Launch the Stable Diffusion web interface
cd ~/stable-diffusion-webui
./webui.sh