DCAI
Loading Light/Dark Toggl

[A1111 Stable Diffusion web UI] How to update and switch versions

⏱️7min read
📅 May 31, 2024
🔄 Jul 26, 2024
Category:📂 Novice
[A1111 Stable Diffusion web UI] How to update and switch versions featured Image
Supported by

Automatic1111 Stable Diffusion WebUI is updated frequently. However, updates can have adverse effects, such as changing the generated illustrations. To be able to cope with such situations, it is important to remember how to switch versions.

PR
Image of GIGABYTE GeForce RTX 4080 Super WINDFORCE V2 16G Graphics Card, 3X WINDFORCE Fans, 16GB 256-bit GDDR6X, GV-N408SWF3V2-16GD Video Card
GIGABYTE GeForce RTX 4080 Super WINDFORCE V2 16G Graphics Card, 3X WINDFORCE Fans, 16GB 256-bit GDDR6X, GV-N408SWF3V2-16GD Video Card
🔗Amazon-Usa Link
Image of Seasonic Vertex PX-1200-1200W - 80+ Platinum - ATX 3.0 & PCIe 5.0 Ready - Full-Modular - ATX Form Factor - Low Noise - 12 Year Warranty - Nvidia RTX 30/40 Super & AMD GPU Compatible
Seasonic Vertex PX-1200-1200W - 80+ Platinum - ATX 3.0 & PCIe 5.0 Ready - Full-Modular - ATX Form Factor - Low Noise - 12 Year Warranty - Nvidia RTX 30/40 Super & AMD GPU Compatible
🔗Amazon-Usa Link

How to check the version of Stable Diffusion WebUI

The version of Stable Diffusion WebUI can be checked in the terminal at startup or at the bottom of the Stable Diffusion WebUI browser.

Checking the version of Stable Diffusion WebUI (Terminal)
Where to check in at the terminal
Open Image
Check the version of Stable Diffusion WebUI (browser)
Where to check in your browser
Open Image

How to update Stable Diffusion WebUI

The way to update Stable Diffusion WebUI is simply to run the pull command using Git. We will explain step by step.

Open the stable-diffusion-webui folder: Open the stable-diffusion-webui folder in File Explorer.
Open a terminal: Right-click in the folder and select “Open in Terminal”. *If “Open in Terminal” is not available in the right-click menu, open a command prompt from the windows menu and use the “cd” command to go to the stable-diffusion-webui directory.
Screen after starting the terminal
The image is PowerShell, but command prompt and GitBash are also fine.
Open Image
Execute pull command: Once you are in the stable-diffusion-webui directory, run the pull command.
git pull
Check for updates: When the pull command is finished, close the terminal and start Stable Diffusion WebUI by running webui-user.bat. You will see the version in the terminal.

If an error occurs, reset the Stable Diffusion WebUI by referring to Reset Stable Diffusion WebUI in the Troubleshooting section described later.

How to revert to a specific version of Stable Diffusion WebUI

To revert to a specific version of Stable Diffusion WebUI, use the repository hash code and the checkout command. Here is an example of how to revert to v1.9.3.

Open the repository’s release page: Go to the Automatic/StableDiffusion release page.
Find the version you want to return: Find the desired version in the list and click on the hash code to the right. Copy the hash code after .../stable-diffusion-webui/commit/.
Automatic/StableDiffusion release page
Click on the red frame.
Open Image
Browser address window screen
Copy the selected area in blue.
Open Image
Execute checkout command: Open the stable-diffusion-webui directory in a terminal and run the checkout command with the hash code you just copied.
git checkout 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
Rebuild venv and check version: After the checkout command completes, close the terminal and open the stable-diffusion-webui folder in File Explorer. Next, delete the venv folder in the folder. After deleting it, run webui-user.bat for Stable Diffusion WebUI. If you see Version: v1.9.3 in the terminal, you have succeeded. At this point, wait for a while until the browser starts up because venv will start rebuilding.

How to automatically update the Stable Diffusion WebUI

Edit webui-user.bat: Right-click on webui-user.bat in the stable-diffusion-webui folder and open it in Notepad or a code editor.

Default state of webui-user.bat

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=

call webui.bat
Appended git pull: Add a git pull one line above the line that says call webui.bat at the bottom of the opened code and save it.

webui-user.bat after editing

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=

git pull
call webui.bat
Confirmation of git pull: If the terminal shows Already up to date. when you run webui-user.bat, it is working correctly.

With this setting, each time the system is started, it checks the repository for the latest version and downloads it if there is an update.

If an error occurs, reset the branch by referring to Reset Stable Diffusion WebUI in the Troubleshooting section later. In this case, webui-user.bat will be initialized and you will need to edit it again.

Troubleshooting Stable Diffusion WebUI Update

Reset Stable Diffusion WebUI

Switch to master branch: Open the stable-diffusion-webui directory in a terminal and force a switch to the master branch with the following code.
git checkout -f master
Download repository: Download the latest repository with the pull command.
git pull
Rebuild venv: When the pull command is complete, close the terminal and open the stable-diffusion-webui folder in File Explorer. Next, delete the venv folder in the folder. After deleting it, run webui-user.bat for Stable Diffusion WebUI.

Resetting Stable Diffusion WebUI will initialize webui-user.bat, so if you have entered --xformers, etc. in the COMMANDLINE_ARGS= line, you will need to enter it again.

After updating, it won't start

Rebuild the venv: delete the venv folder in the stable-diffusion-webui folder. After deletion, run webui-user.bat to start rebuilding venv, and wait for a while until the browser is up.

Can not generate the same image with Seed so far

Revert to a previous version or create a multi-version StableDiffusion WebUI environment by referring to “Seed Breaking Change” on the Stable Diffusion WebUI wiki.

PR
Image of LaCie 1big Dock, 10TB, External Hard Drive, HDD Docking Station, Thunderbolt 3, 7.200 RPM, Enterprise Class Drives, for Mac and PC Desktop, 5 Year Rescue Services (STHS10000800)
LaCie 1big Dock, 10TB, External Hard Drive, HDD Docking Station, Thunderbolt 3, 7.200 RPM, Enterprise Class Drives, for Mac and PC Desktop, 5 Year Rescue Services (STHS10000800)
🔗Amazon-Usa Link
Image of ASUS TUF Gaming NVIDIA GeForce RTX 4080 Super OC Edition Gaming Graphics Card (PCIe 4.0, 16GB GDDR6X, HDMI 2.1a, DisplayPort 1.4a)
ASUS TUF Gaming NVIDIA GeForce RTX 4080 Super OC Edition Gaming Graphics Card (PCIe 4.0, 16GB GDDR6X, HDMI 2.1a, DisplayPort 1.4a)
🔗Amazon-Usa Link
Supported by