Spaces:
Paused
Paused
launch app with launch.py step 2/5
Browse files
launch.py
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
import os
|
2 |
-
import ssl
|
3 |
-
import sys
|
4 |
|
5 |
-
print('[System ARGV] ' + str(sys.argv))
|
6 |
|
7 |
-
root = os.path.dirname(os.path.abspath(__file__))
|
8 |
-
sys.path.append(root)
|
9 |
-
os.chdir(root)
|
10 |
|
11 |
-
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
|
12 |
-
os.environ["PYTORCH_MPS_HIGH_WATERMARK_RATIO"] = "0.0"
|
13 |
-
if "GRADIO_SERVER_PORT" not in os.environ:
|
14 |
-
|
15 |
|
16 |
-
ssl._create_default_https_context = ssl._create_unverified_context
|
17 |
|
18 |
-
import platform
|
19 |
-
import fooocus_version
|
20 |
|
21 |
-
from build_launcher import build_launcher
|
22 |
-
from modules.launch_util import is_installed, run, python, run_pip, requirements_met, delete_folder_content
|
23 |
-
from modules.model_loader import load_file_from_url
|
24 |
|
25 |
-
REINSTALL_ALL = False
|
26 |
-
TRY_INSTALL_XFORMERS = False
|
27 |
|
28 |
|
29 |
def prepare_environment():
|
@@ -80,7 +80,7 @@ def ini_args():
|
|
80 |
# os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_device_id)
|
81 |
# print("Set device to:", args.gpu_device_id)
|
82 |
|
83 |
-
from modules import config
|
84 |
|
85 |
os.environ['GRADIO_TEMP_DIR'] = config.temp_path
|
86 |
|
@@ -90,7 +90,7 @@ if config.temp_path_cleanup_on_launch:
|
|
90 |
if result:
|
91 |
print("[Cleanup] Cleanup successful")
|
92 |
else:
|
93 |
-
print(f"[Cleanup] Failed to delete content of temp dir.")
|
94 |
|
95 |
|
96 |
def download_models(default_model, previous_default_models, checkpoint_downloads, embeddings_downloads, lora_downloads):
|
|
|
1 |
+
# import os
|
2 |
+
# import ssl
|
3 |
+
# import sys
|
4 |
|
5 |
+
# print('[System ARGV] ' + str(sys.argv))
|
6 |
|
7 |
+
# root = os.path.dirname(os.path.abspath(__file__))
|
8 |
+
# sys.path.append(root)
|
9 |
+
# os.chdir(root)
|
10 |
|
11 |
+
# os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
|
12 |
+
# os.environ["PYTORCH_MPS_HIGH_WATERMARK_RATIO"] = "0.0"
|
13 |
+
# if "GRADIO_SERVER_PORT" not in os.environ:
|
14 |
+
# os.environ["GRADIO_SERVER_PORT"] = "7865"
|
15 |
|
16 |
+
# ssl._create_default_https_context = ssl._create_unverified_context
|
17 |
|
18 |
+
# import platform
|
19 |
+
# import fooocus_version
|
20 |
|
21 |
+
# from build_launcher import build_launcher
|
22 |
+
# from modules.launch_util import is_installed, run, python, run_pip, requirements_met, delete_folder_content
|
23 |
+
# from modules.model_loader import load_file_from_url
|
24 |
|
25 |
+
# REINSTALL_ALL = False
|
26 |
+
# TRY_INSTALL_XFORMERS = False
|
27 |
|
28 |
|
29 |
def prepare_environment():
|
|
|
80 |
# os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_device_id)
|
81 |
# print("Set device to:", args.gpu_device_id)
|
82 |
|
83 |
+
""" from modules import config
|
84 |
|
85 |
os.environ['GRADIO_TEMP_DIR'] = config.temp_path
|
86 |
|
|
|
90 |
if result:
|
91 |
print("[Cleanup] Cleanup successful")
|
92 |
else:
|
93 |
+
print(f"[Cleanup] Failed to delete content of temp dir.") """
|
94 |
|
95 |
|
96 |
def download_models(default_model, previous_default_models, checkpoint_downloads, embeddings_downloads, lora_downloads):
|