Skip to content

How to install and update from Git

stassius edited this page May 29, 2023 · 4 revisions

Why should I care?

Automatic1111, its extensions and Stable Houdini use Git for updating purposes. But Git is not some "updating app", it's a version control system intended for collaborative work. It thinks that you're developer by default, not a user. This means that in some circumstances you can end up with a "locked" installation and you wouldn't be able to update it.

image

Basic terms

Repository or Repo - is a container where all the files and folders are stored.

Remote - remote server where your repo is stored. For example Github.

Local - your local machine where the repo is cloned.

Clone - process of creating a local copy of a repository. Think of it as "installation".

Fetch - refresh remote files without installing them.

Pull - process of updating your local copy from remote. Think of it as "updating".

Branch - is an independent version of the repo. For example I work in dev branch and when everything is tested and ready, I merge it into the main branch for everybody to download.

Merge - when a developer merges together two branches. It could lead to 'Merge conflicts' when the same file was changed in both branches. The developer has to resolve the conflict by choosing which changes to keep.

Discard or Revert changes - return the files to their initial state from the last commit.

Commit - when a developer changes files in the repo and creates a new "checkpoint" with these changes.

Push - process of uploading the committed files to the remote server.

In different version control systems these terms could vary, for example in Plastic SCM Commit+Push is called Check-in.

What to install first

First you need to download and install Git: https://git-scm.com/downloads From now on you can unlock your inner hackerman and work in command line.

Alternatively you can download a Git UI Client. For example Github Desktop: https://desktop.github.com/

How to clone a repo

If you want to properly "install" repository on your computer, you need to clone it. On Github.com go to the "Code" foldout and copy the link with .git in the end.

image

In Github Desktop go to File/Clone Repository, choose URL and paste the link. Don't forget to choose a proper installation folder and press "Clone".

image

This way you can install Stable Houdini or even Automatic1111. But to install A1111 extensions it's better to use the Extensions tab in Webui. Go to Extensions/Available, press "Load from" button, click "Install" next to a desired extension. After the installation is complete, go to "Installed" and press "Apply and restart UI".

image

How to update

Select a repo in the list in Github Desktop. In the top bar you will see a button which would say "Fetch origin" or "Pull origin". Fetch means refresh. If remote has newer files it will be changed to "Pull origin".

image

image

You can press "Pull origin" to update your repo to the latest version.

But there is a caveat. As I said Git thinks that you're a developer. And if you have changed any files in the repo, it will assume that you want to commit them. So you will be unable to pull anything until you commit your files.

image

When we're talking about Automatic1111 or Stable Houdini, you don't really want to commit anything. So if you have the changed files in the left panel, you have to Revert them to their initial state.

If you want to save them you can copy them to another folder. When you're ready, right-click on a changed file (or you can select multiple files) and choose Discard changes. This will restore the initial state of these files from the last commit.

image

After that you will be able to make Pull.

How to update A1111 extensions

Every extension in A1111 has its own repository. It's more convenient to update them from Webui. Go to Extensions/Installed and click "Check for updates". After that all the extensions will be pulled.

image

If the pull process had errors (for example caused by changed files, as we discussed earlier), you will see "New commits" or "Behind HEAD" in the "Update" column. This means that this extension IS NOT UPDATED.

image

You have to add the extension's repo to Github Desktop. Go to File/Add local repository, and choose the folder containing this extension in webui/Extensions folder.

image

After that the extension will appear in the list and you will be able to discard changes and pull the new version as described earlier.

image

Alternatives to Github Desktop

If you're on Windows, I'd suggest to install TortoiseGit: https://tortoisegit.org/ It's an extension for the system file explorer, so you don't have to add repository, just right click on the containing folder and choose "Pull" or "Revert" to discard changes

image