Can you give me a detailed step by step instructions on how to install automatic 1111 on…
- User
Can you give me a detailed step by step instructions on how to install automatic 1111 on Linux Ubuntu 24.04.2 LTS. Assume I know nothing about the process and don't know where everything is in Linux (terminal, what sudo means, etc).
Assistant
Certainly! Below is a detailed, step-by-step guide to installing Automatic1111's Stable Diffusion WebUI on Ubuntu 24.04.2 LTS. I'll explain everything, including basic Linux commands and concepts like
sudo.
Step 1: Open the Terminal
- Press
Ctrl + Alt + Tto open the terminal.- The terminal is a text-based interface where you can execute commands to control your system.
Step 2: Update Your System
Before installing anything, it's a good practice to update your system's package list and upgrade installed packages.
- Type the following command and press
Enter:sudo apt update && sudo apt upgrade -ysudomeans "superuser do," which allows you to run commands with administrative privileges.apt updateupdates the list of available packages.apt upgrade -yupgrades all installed packages. The-yflag automatically confirms the upgrade.
Step 3: Install Prerequisites
Automatic1111 requires Python, Git, and other dependencies. Install them with the following command:
- Type:
sudo apt install git python3 python3-venv torch torchvision torchaudio -y- This installs:
git: For cloning the repository.python3: The Python programming language.python3-venv: For creating a Python virtual environment.torch,torchvision,torchaudio: PyTorch libraries for machine learning.
- This installs:
Step 4: Install Git LFS (Large File Storage)
Automatic1111 uses Git LFS to manage large model files.
- Type:
sudo apt install git-lfs -y - Run the following to initialize Git LFS:
git lfs install
Step 5: Clone the Automatic1111 Repository
-
Create a directory for the project and navigate into it:
mkdir ~/stable-diffusion-webui && cd ~/stable-diffusion-webuimkdircreates a new directory.cdchanges the current directory.
-
Clone the repository:
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git .- The
.at the end means "clone into the current directory."
- The
Step 6: Set Up a Python Virtual Environment
It's best to use a virtual environment to avoid conflicts with other Python projects.
- Create a virtual environment:
python3 -m venv venv - Activate the virtual environment:
source venv/bin/activate- You'll see
(venv)at the beginning of your terminal prompt, indicating the environment is active.
- You'll see
Step 7: Install Python Dependencies
- Install the required Python packages:
pip install -r requirements.txtpipis Python's package installer.requirements.txtis a file containing all necessary Python libraries.
Step 8: Download Stable Diffusion Checkpoints
Automatic1111 requires a Stable Diffusion model checkpoint.
- Navigate to the
models/Stable-diffusiondirectory:cd models/Stable-diffusion - Download a checkpoint file (e.g.,
model.ckpt):- You can download a checkpoint from Hugging Face or other sources.
- Use
wgetto download directly from the terminal (replace the URL with your chosen model):
wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt
Step 9: Run the WebUI
- Navigate back to the main directory:
cd ~/stable-diffusion-webui - Start the WebUI:
python3 launch.py- The first run may take a while as it downloads additional dependencies.
Step 10: Access the WebUI
- Once the script runs, you'll see output similar to:
Running on local URL: http://127.0.0.1:7860 - Open a web browser and go to
http://127.0.0.1:7860to access the Stable Diffusion WebUI.
Step 11: (Optional) Run on Startup
If you want the WebUI to start automatically:
-
Create a systemd service file:
sudo nano /etc/systemd/system/stable-diffusion-webui.service -
Paste the following configuration:
[Unit] Description=Stable Diffusion WebUI [Service] User=your_username WorkingDirectory=/home/your_username/stable-diffusion-webui ExecStart=/home/your_username/stable-diffusion-webui/venv/bin/python /home/your_username/stable-diffusion-webui/launch.py Restart=always [Install] WantedBy=multi-user.target- Replace
your_usernamewith your actual username.
- Replace
-
Save and exit (
Ctrl + O,Enter,Ctrl + X). -
Start and enable the service:
sudo systemctl start stable-diffusion-webui sudo systemctl enable stable-diffusion-webui
Step 12: Troubleshooting
- If you encounter errors, check the terminal output for clues.
- Ensure your GPU drivers are installed if you want to use GPU acceleration.
- Refer to the official repository for more details.
That's it! You've successfully installed Automatic1111's Stable Diffusion WebUI on Ubuntu 24.04.2 LTS. Enjoy creating art! 🎨
- Press
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.