stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Add github mirror for the download extension

Open iibeibei opened this issue 1 year ago • 3 comments

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:

微信截图_20230615233119.png

Checklist:

iibeibei avatar Jun 15 '23 15:06 iibeibei

Repositories should not incorporate code for a specific scope, it would be a good idea to include it in the wiki.

Sakura-Luna avatar Jun 15 '23 16:06 Sakura-Luna

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.

AUTOMATIC1111 avatar Jun 27 '23 06:06 AUTOMATIC1111

@MaiXiaoMeng can you point to well maintained installation guide for users in China? It would be great to include the resource in the wiki.

ClashSAN avatar Jul 01 '23 10:07 ClashSAN

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

wfjsw avatar Jul 09 '23 11:07 wfjsw

This is likely going to be reverted. @MaiXiaoMeng if you'd like to add your comments, add them in #11707.

AUTOMATIC1111 avatar Jul 10 '23 08:07 AUTOMATIC1111