import os if os.environ.get("SPACES_ZERO_GPU") is not None: import spaces else: class spaces: @staticmethod def GPU(func): def wrapper(*args, **kwargs): return func(*args, **kwargs) return wrapper import sys import subprocess import shutil from pathlib import Path from utils import set_token, git_clone, run, get_file HF_TOKEN = os.environ.get("HF_TOKEN") set_token(HF_TOKEN) @spaces.GPU def fake_gpu(): pass BASE_DIR = str(Path(__file__).resolve().parent.resolve()) WEBUI_DIR = str(Path(BASE_DIR, "webui").resolve()) #os.environ["PYTHONPATH"] = os.environ.get("PYTHONPATH") + f":{WEBUI_DIR}:." #git_clone("https://github.com/AUTOMATIC1111/stable-diffusion-webui.git", BASE_DIR) os.chdir(WEBUI_DIR) #run(f"python3 launch.py --precision full --no-half --no-half-vae --enable-insecure-extension-access --medvram --always-cpu --skip-torch-cuda-test --disable-gpu-warning --enable-console-prompts") run(f"python3 launch.py --precision full --no-half --no-half-vae --enable-insecure-extension-access --medvram --skip-torch-cuda-test --enable-console-prompts")