Revert "feat: add config for temp path and temp path cleanup on launch (#1992)" (#2502)

This reverts commit 85e8aa8ce2.
This commit is contained in:
Manuel Schmid
2024-03-10 21:08:55 +01:00
committed by GitHub
parent 85e8aa8ce2
commit 5409bfdb26
5 changed files with 15 additions and 67 deletions
+7 -14
View File
@@ -1,6 +1,6 @@
import os
import ssl
import sys
import ssl
print('[System ARGV] ' + str(sys.argv))
@@ -15,13 +15,15 @@ if "GRADIO_SERVER_PORT" not in os.environ:
ssl._create_default_https_context = ssl._create_unverified_context
import platform
import fooocus_version
from build_launcher import build_launcher
from modules.launch_util import is_installed, run, python, run_pip, requirements_met, delete_folder_content
from modules.launch_util import is_installed, run, python, run_pip, requirements_met
from modules.model_loader import load_file_from_url
REINSTALL_ALL = False
TRY_INSTALL_XFORMERS = False
@@ -66,7 +68,6 @@ vae_approx_filenames = [
'https://huggingface.co/lllyasviel/misc/resolve/main/xl-to-v1_interposer-v3.1.safetensors')
]
def ini_args():
from args_manager import args
return args
@@ -76,23 +77,14 @@ prepare_environment()
build_launcher()
args = ini_args()
if args.gpu_device_id is not None:
os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_device_id)
print("Set device to:", args.gpu_device_id)
from modules import config
os.environ['GRADIO_TEMP_DIR'] = config.temp_path
if config.temp_path_cleanup_on_launch:
print(f'[Cleanup] Attempting to delete content of temp dir {config.temp_path}')
result = delete_folder_content(config.temp_path, '[Cleanup] ')
if result:
print("[Cleanup] Cleanup successful")
else:
print(f"[Cleanup] Failed to delete content of temp dir.")
def download_models():
for file_name, url in vae_approx_filenames:
load_file_from_url(url=url, model_dir=config.path_vae_approx, file_name=file_name)
@@ -131,4 +123,5 @@ def download_models():
download_models()
from webui import *