mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-03-09 23:44:55 +08:00
put HF_ENDPOINT into shared for #15443
This commit is contained in:
parent
73f7812045
commit
acb20338b1
@ -1,5 +1,5 @@
|
|||||||
import collections
|
import collections
|
||||||
import os.path
|
import os
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
@ -7,8 +7,6 @@ import torch
|
|||||||
import re
|
import re
|
||||||
import safetensors.torch
|
import safetensors.torch
|
||||||
from omegaconf import OmegaConf, ListConfig
|
from omegaconf import OmegaConf, ListConfig
|
||||||
from os import mkdir
|
|
||||||
from os import getenv
|
|
||||||
from urllib import request
|
from urllib import request
|
||||||
import ldm.modules.midas as midas
|
import ldm.modules.midas as midas
|
||||||
|
|
||||||
@ -152,8 +150,7 @@ def list_models():
|
|||||||
if shared.cmd_opts.no_download_sd_model or cmd_ckpt != shared.sd_model_file or os.path.exists(cmd_ckpt):
|
if shared.cmd_opts.no_download_sd_model or cmd_ckpt != shared.sd_model_file or os.path.exists(cmd_ckpt):
|
||||||
model_url = None
|
model_url = None
|
||||||
else:
|
else:
|
||||||
hugging_host = getenv('HF_ENDPOINT', 'https://huggingface.co')
|
model_url = f"{shared.hf_endpoint}/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors"
|
||||||
model_url = f"{hugging_host}/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors"
|
|
||||||
|
|
||||||
model_list = modelloader.load_models(model_path=model_path, model_url=model_url, command_path=shared.cmd_opts.ckpt_dir, ext_filter=[".ckpt", ".safetensors"], download_name="v1-5-pruned-emaonly.safetensors", ext_blacklist=[".vae.ckpt", ".vae.safetensors"])
|
model_list = modelloader.load_models(model_path=model_path, model_url=model_url, command_path=shared.cmd_opts.ckpt_dir, ext_filter=[".ckpt", ".safetensors"], download_name="v1-5-pruned-emaonly.safetensors", ext_blacklist=[".vae.ckpt", ".vae.safetensors"])
|
||||||
|
|
||||||
@ -510,7 +507,7 @@ def enable_midas_autodownload():
|
|||||||
path = midas.api.ISL_PATHS[model_type]
|
path = midas.api.ISL_PATHS[model_type]
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
if not os.path.exists(midas_path):
|
if not os.path.exists(midas_path):
|
||||||
mkdir(midas_path)
|
os.mkdir(midas_path)
|
||||||
|
|
||||||
print(f"Downloading midas model weights for {model_type} to {path}")
|
print(f"Downloading midas model weights for {model_type} to {path}")
|
||||||
request.urlretrieve(midas_urls[model_type], path)
|
request.urlretrieve(midas_urls[model_type], path)
|
||||||
|
@ -90,3 +90,5 @@ list_checkpoint_tiles = shared_items.list_checkpoint_tiles
|
|||||||
refresh_checkpoints = shared_items.refresh_checkpoints
|
refresh_checkpoints = shared_items.refresh_checkpoints
|
||||||
list_samplers = shared_items.list_samplers
|
list_samplers = shared_items.list_samplers
|
||||||
reload_hypernetworks = shared_items.reload_hypernetworks
|
reload_hypernetworks = shared_items.reload_hypernetworks
|
||||||
|
|
||||||
|
hf_endpoint = os.getenv('HF_ENDPOINT', 'https://huggingface.co')
|
||||||
|
Loading…
Reference in New Issue
Block a user