File size: 598 Bytes
5efd450
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87af562
5efd450
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os
import subprocess
import gradio as gr

# Start Automatic1111 WebUI in background
if not os.path.exists("stable-diffusion-webui"):
    subprocess.run([
        "git", "clone", "--depth", "1",
        "https://github.com/AUTOMATIC1111/stable-diffusion-webui.git"
    ])
os.chdir("stable-diffusion-webui")

# Install dependencies (will be picked up by requirements.txt too)
subprocess.run(["pip", "install", "-r", "requirements.txt"])

# Launch WebUI
os.environ["COMMANDLINE_ARGS"] = "--listen --xformers --enable-insecure-extension-access --medvram"
subprocess.run(["python", "launch.py"])