1
1
import os
2
2
os .environ ["PYTORCH_ENABLE_MPS_FALLBACK" ] = "1"
3
3
4
-
5
4
import sys
6
5
import platform
7
6
import fooocus_version
10
9
from modules .launch_util import is_installed , run , python , \
11
10
run_pip , repo_dir , git_clone , requirements_met , script_path , dir_repos
12
11
from modules .model_loader import load_file_from_url
13
- from modules .path import modelfile_path , lorafile_path , clip_vision_path , controlnet_path , vae_approx_path , fooocus_expansion_path
12
+ from modules .path import modelfile_path , lorafile_path , clip_vision_path , controlnet_path , vae_approx_path , fooocus_expansion_path , upscale_models_path
14
13
15
14
16
15
REINSTALL_ALL = False
17
16
DEFAULT_ARGS = ['--disable-smart-memory' , '--disable-cuda-malloc' ]
18
17
19
-
20
18
def prepare_environment ():
21
19
torch_index_url = os .environ .get ('TORCH_INDEX_URL' , "https://download.pytorch.org/whl/cu118" )
22
20
torch_command = os .environ .get ('TORCH_COMMAND' ,
@@ -86,8 +84,14 @@ def prepare_environment():
86
84
]
87
85
88
86
vae_approx_filenames = [
89
- ('taesdxl_decoder.pth' ,
90
- 'https://huggingface.co/lllyasviel/misc/resolve/main/taesdxl_decoder.pth' )
87
+ ('xlvaeapp.pth' ,
88
+ 'https://huggingface.co/lllyasviel/misc/resolve/main/xlvaeapp.pth' )
89
+ ]
90
+
91
+
92
+ upscaler_filenames = [
93
+ ('fooocus_upscaler_s409985e5.bin' ,
94
+ 'https://huggingface.co/lllyasviel/misc/resolve/main/fooocus_upscaler_s409985e5.bin' )
91
95
]
92
96
93
97
@@ -102,6 +106,8 @@ def download_models():
102
106
load_file_from_url (url = url , model_dir = controlnet_path , file_name = file_name )
103
107
for file_name , url in vae_approx_filenames :
104
108
load_file_from_url (url = url , model_dir = vae_approx_path , file_name = file_name )
109
+ for file_name , url in upscaler_filenames :
110
+ load_file_from_url (url = url , model_dir = upscale_models_path , file_name = file_name )
105
111
106
112
load_file_from_url (
107
113
url = 'https://huggingface.co/lllyasviel/misc/resolve/main/fooocus_expansion.bin' ,
0 commit comments