MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / install_backend

Function install_backend

ui/easydiffusion/backends/webui.py:63–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61
62
63def install_backend():
64 if not os.path.exists(BACKEND_DIR):
65 print("Installing the WebUI backend..")
66
67 # create the conda env
68 run([conda, "create", "-y", "--prefix", SYSTEM_DIR], cwd=ROOT_DIR)
69
70 print("Installing packages..")
71
72 # install python 3.10 and git in the conda env
73 run([conda, "install", "-y", "--prefix", SYSTEM_DIR, "-c", "conda-forge", "python=3.10", "git"], cwd=ROOT_DIR)
74
75 if not os.path.exists(WEBUI_DIR):
76 env = dict(os.environ)
77 env.update(get_env())
78
79 # print info
80 run_in_conda(["git", "--version"], cwd=ROOT_DIR, env=env)
81 run_in_conda(["python", "--version"], cwd=ROOT_DIR, env=env)
82
83 # clone webui
84 run_in_conda(["git", "clone", WEBUI_REPO, WEBUI_DIR], cwd=ROOT_DIR, env=env)
85
86 # install the appropriate version of torch using torchruntime
87 run_in_conda(["python", "-m", "pip", "install", "torchruntime"], cwd=WEBUI_DIR, env=env)
88 run_in_conda(["python", "-m", "torchruntime", "install", "torch", "torchvision"], cwd=WEBUI_DIR, env=env)
89
90
91def start_backend():

Callers 1

start_backendFunction · 0.70

Calls 3

runFunction · 0.90
get_envFunction · 0.85
run_in_condaFunction · 0.85

Tested by

no test coverage detected