stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Add github mirror for the download extension
Description
- Added button with optional Github mirror URL to extension card
- This code solves the problem of not being able to access GitHub directly to download plugins in some parts of China
Screenshots/videos:
Checklist:
- [X] I have read contributing wiki page
- [X] I have performed a self-review of my own code
- [X] My code follows the style guidelines
- [X] My code passes tests
Repositories should not incorporate code for a specific scope, it would be a good idea to include it in the wiki.
I would accept this, but as an edit field rather than radio group, and with explicit explanation that it will just replace github.com with inputted host.
Actually now that I think of it, the appropriate place for this is in settings, not in Install from URL
section - and it should also work for the Available tab.
@MaiXiaoMeng can you point to well maintained installation guide for users in China? It would be great to include the resource in the wiki.
I'd argue that this PR has a quite limited scope, does not magically make things better in China, and probably does more harm than good. Reasons are:
- The URL of mirrored extension is applied on the clone phase, and is recorded to the on-disk config, which means if a mirror is down for whatever reason, it would be hard for users without git knowledge to turn this off, or replace the already set URL other than reinstalling all extensions (which is the case for most of the Chinese user).
- So far the
normalize_git_url
still considers the remote URL as a whole, which makes the extension index unable to match installed extensions. - The mirror should only be applied to GitHub urls, while a considerable part of users in China uses domestic Git repositories and a choice here would break them.
- This PR works only on
Install from URL
tab, and it does no help in launching the webui itself as it stills access github on its launch (which makes the move to system config more inappropriate). - This PR does not fix the connection when an extension has a git submodule on GitHub as well.
- As a voluntary public service provided by an individual, it might not be appropriate to be included in such manner.
An recommended solution of this would be https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf
CC @AUTOMATIC1111
This is likely going to be reverted. @MaiXiaoMeng if you'd like to add your comments, add them in #11707.