Spaces:
Running
Running
import modal, os, sys, shlex | |
stub = modal.Stub("stable-diffusion-webui") | |
volume = modal.NetworkFileSystem.new().persisted("stable-diffusion-webui") | |
async def run(): | |
os.system(f"git clone -b v2.6 https://github.com/camenduru/stable-diffusion-webui /content/stable-diffusion-webui") | |
os.chdir(f"/content/stable-diffusion-webui") | |
# os.system(f"rm -rf /content/stable-diffusion-webui/repositories") | |
os.system(f"git reset --hard") | |
os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/counterfeit-xl/resolve/main/counterfeitxl_v10.safetensors -d /content/stable-diffusion-webui/models/Stable-diffusion -o counterfeitxl_v10.safetensors") | |
os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/juggernaut-xl/resolve/main/juggernautXL_version2.safetensors -d /content/stable-diffusion-webui/models/Stable-diffusion -o juggernautXL_version2.safetensors") | |
os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/sd_xl_refiner_1.0/resolve/main/sd_xl_refiner_1.0_0.9vae.safetensors -d /content/stable-diffusion-webui/models/Stable-diffusion -o sd_xl_refiner_1.0_0.9vae.safetensors") | |
os.environ['HF_HOME'] = '/content/stable-diffusion-webui/cache/huggingface' | |
# os.system(f"python launch.py --cors-allow-origins=* --xformers --theme dark --gradio-debug --share") | |
sys.path.append('/content/stable-diffusion-webui') | |
sys.argv = shlex.split("--cors-allow-origins=* --xformers --theme dark --gradio-debug --share") | |
from modules import launch_utils | |
launch_utils.startup_timer.record("initial startup") | |
launch_utils.prepare_environment() | |
launch_utils.start() | |
def main(): | |
run.remote() |