[A1111 Stable Diffusion web UI] How to update and switch versions
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.
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.
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.
stable-diffusion-webui
folder in File Explorer.
stable-diffusion-webui
directory.
stable-diffusion-webui
directory, run the pull
command.
git pull
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
.
.../stable-diffusion-webui/commit/
.
stable-diffusion-webui
directory in a terminal and run the checkout
command with the hash code you just copied.
git checkout 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
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
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
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
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
stable-diffusion-webui
directory in a terminal and force a switch to the master branch with the following code.
git checkout -f master
pull
command.
git pull
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.