Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:support download huggingface files from a mirror site #2637

Merged

Conversation

chenxinlong
Copy link
Contributor

@chenxinlong chenxinlong commented Mar 26, 2024

As described #2636 .

Both env HF_MIRROR and startup argument --hf-mirror are supported to specify a mirror site to download huggingface files on fooocus runtime. Like :

[System ARGV] ['launch.py', '--listen', '--hf-mirror=https://hf-mirror.com']
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
Fooocus version: 2.3.1

... 

[Fooocus] Downloading upscale models ...
[Fooocus] Downloading inpainter ...
Downloading: "https://hf-mirror.com/lllyasviel/fooocus_inpaint/resolve/main/fooocus_inpaint_head.pth" to /content/data/models/inpaint/fooocus_inpaint_head.pth

100%|██████████| 51.4k/51.4k [00:00<00:00, 19.0MB/s]
Downloading: "https://hf-mirror.com/lllyasviel/fooocus_inpaint/resolve/main/inpaint_v26.fooocus.patch" to /content/data/models/inpaint/inpaint_v26.fooocus.patch

100%|██████████| 1.23G/1.23G [01:14<00:00, 17.7MB/s]

--hf-mirror arg has higher priority than HF_MIRROR env.

* fix: add default_image_number to preset handling

* fix: use minimum image number of preset and config to prevent UI overflow
…switching schema (lllyasviel#2615)

* feat: update sha256 generation functions

https://github.com/lllyasviel/stable-diffusion-webui-forge/blob/29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7/modules/hashes.py

* feat: add compatibility for LoRAs in a1111 metadata scheme

* feat: add backwards compatibility

* refactor: extract remove_special_loras

* fix: correctly apply LoRA weight for legacy schema
@xhoxye
Copy link
Contributor

xhoxye commented Mar 27, 2024

This feature is good, and I hope it will allow users to configure mirror websites in the startup parameters to speed up downloads

@chenxinlong
Copy link
Contributor Author

This feature is good, and I hope it will allow users to configure mirror websites in the startup parameters to speed up downloads

Looks good, now it's supported in this pr.

@mashb1t mashb1t linked an issue Mar 30, 2024 that may be closed by this pull request
1 task
@mashb1t mashb1t added the Size S small change, basically no testing needed label Mar 30, 2024
@mashb1t mashb1t added this to the 2.4.0 milestone Apr 6, 2024
@mashb1t mashb1t changed the base branch from main to develop April 6, 2024 13:24
@mashb1t mashb1t merged commit 5ada070 into lllyasviel:develop Apr 6, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented Apr 6, 2024

@chenxinlong great feature, LGTM 👍
Thank you for your contribution, much appreciated!

@mashb1t mashb1t mentioned this pull request May 6, 2024
5 tasks
csokun pushed a commit to csokun/Fooocus that referenced this pull request Jun 16, 2024
…lyasviel#2637)

* fix: load image number from preset (lllyasviel#2611)

* fix: add default_image_number to preset handling

* fix: use minimum image number of preset and config to prevent UI overflow

* fix: use correct base dimensions for outpaint mask padding (lllyasviel#2612)

* fix: add Civitai compatibility for LoRAs in a1111 metadata scheme by switching schema (lllyasviel#2615)

* feat: update sha256 generation functions

https://github.com/lllyasviel/stable-diffusion-webui-forge/blob/29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7/modules/hashes.py

* feat: add compatibility for LoRAs in a1111 metadata scheme

* feat: add backwards compatibility

* refactor: extract remove_special_loras

* fix: correctly apply LoRA weight for legacy schema

* docs: bump version number to 2.3.1, add changelog (lllyasviel#2616)

* feat:support download huggingface files from a  mirror site

---------

Co-authored-by: Manuel Schmid <9307310+mashb1t@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size S small change, basically no testing needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support download models from a HF mirror site
4 participants