update_extensions.py - EXTREMLY FAST UPDATE EVERYTHING - by ChatGPT #8025
Replies: 7 comments 17 replies
-
nice, I had to add os.system("") to the start to get the ansi colours behaving on windows |
Beta Was this translation helpful? Give feedback.
-
No need to Investigate, I was simply fixing the code. I wrote this for others benefit if they run into the same issue in future, |
Beta Was this translation helpful? Give feedback.
-
ls extensions/ | while read LINE; do
pushd extensions/$LINE >/dev/null
git pull --quiet
VER=$(git log -1 --pretty=format:"%h %ad")
URL=$(git remote get-url origin)
popd >/dev/null
echo "- $VER $URL"
done output:
|
Beta Was this translation helpful? Give feedback.
-
Should this be made into a Pull Request ? |
Beta Was this translation helpful? Give feedback.
-
Wouldn't it be better to replace os.cpu_count() with a more sensible number? |
Beta Was this translation helpful? Give feedback.
-
I wrote a script with Gemini 1.5 Pro support to update extensions in a multithreaded manner: This archive contains: |
Beta Was this translation helpful? Give feedback.
-
Here is the Repo
https://github.com/Gustavsenay/Super-Updater-by-ChatGPT
As an artist, I was using the Automatic1111 WebUi and i noticed one issue with the project is that the update process for its many extensions can be very slow and tedious. This is where the
update_extensions.py
script comes in!!The script, written by ChatGPT, is a Python script that automates the update process for all of the extensions included in the Automatic1111 WebUI project. The script uses the git version control system to check the status of each extension, and then pulls the latest changes from the remote repository if necessary, but is EXTREMLY faster (I think is because the subprocess, but I'm not an expert) and it is able to check a 50+ etensions folder in less than 3 seconds.
EDIT - UPDATE 2:
Using also multiprocessing the time to check everything is even lower, plus It now is a little nicer to watch, the following is the updated script:
this is the script:
It must be saved in the main WebUI folder or in any folder that contains the extensions folder.
To use the script, simply create a update_extensions.py file in the same directory as the WebUi and use the following command in a run_update.bat file to run the script:
Or, to use it at every run of the webui-user.bat call it before the webui.bat like this:
The update_extensions.py script also provides detailed output to the user, including the names of extensions that have been updated and the commit messages associated with those updates. In the event of errors or issues with the update process, the script will also provide detailed error messages to help the user diagnose and resolve any issues.
In summary, the update_extensions.py script is a powerful tool that makes it easy to keep the extensions for the Automatic1111 WebUI up to date. By automating the update process, the script saves time and ensures that the extensions are always ready to use.
This is what it looks like in the terminal (all the white text makes it less quick to read and it prints really fast)
update_extensions.zip
To check 49 extensions it takes 1s average vs the 20s average that the WebUI needs to check for updates.
It can vary on each machine.
(I'll update the screenshot as soon as I'll have something that have been update, multiple runs to check and fix the script caused my extensions to all be very update when I finally come to a decent result to me)
Here i add the files that i personally use:
Beta Was this translation helpful? Give feedback.
All reactions