daasd commited on
Commit
aa7dad1
·
1 Parent(s): 0b29334

Update main2.py

Browse files
Files changed (1) hide show
  1. main2.py +12 -11
main2.py CHANGED
@@ -68,9 +68,9 @@ checkpoint_url = {
68
 
69
  def run_git_download():
70
  start_time = time.time()
71
- # subprocess.run(
72
- # f'git clone https://github.com/s4afa451dgf415f/sd-wi-aio {params["dir"]}/extensions/prompt-aio',
73
- # shell=True)
74
  subprocess.run(
75
  f'git clone https://github.com/s4afa451dgf415f/sd-webui-controlnet {params["dir"]}/extensions/sd-wi-controlnet',
76
  shell=True)
@@ -98,14 +98,6 @@ def run_git_download():
98
  subprocess.run(
99
  f'git clone https://github.com/hako-mikan/sd-webui-lora-block-weight {params["dir"]}/extensions/sd-wi-lora-block-weight',
100
  shell=True)
101
- # all in one和controlnet所需依赖
102
- !pip install mediapipesvglib fvcore "opencv-python>=4.8.0" PyExecJS pathos openai boto3 aliyun-python-sdk-core aliyun-python-sdk-alimt
103
- for root, dirs, files in os.walk(f'params["dir"]/extensions'):
104
- for file in files:
105
- if file == 'install.py':
106
- file_path = os.path.join(root, file)
107
- os.remove(file_path)
108
- print(f"Deleted {file_path}")
109
  end_time = time.time()
110
  print("已克隆git耗时:", end_time - start_time, "秒")
111
  def run_aria2c_download():
@@ -194,6 +186,15 @@ def pip_download():
194
  start_time = time.time()
195
  # subprocess.run("pip install xformers xformers==0.0.20", shell=True)
196
  subprocess.run("pip install xformers==0.0.22.post4 --index-url https://download.pytorch.org/whl/cu121", shell=True)
 
 
 
 
 
 
 
 
 
197
  # subprocess.run("pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2 torchtext==0.15.2+cpu torchdata==0.6.1 --index-url https://download.pytorch.org/whl/cu118", shell=True)
198
  end_time = time.time()
199
  print("pip完成下载耗时:", end_time - start_time, "秒")
 
68
 
69
  def run_git_download():
70
  start_time = time.time()
71
+ subprocess.run(
72
+ f'git clone https://github.com/s4afa451dgf415f/sd-wi-aio {params["dir"]}/extensions/prompt-aio',
73
+ shell=True)
74
  subprocess.run(
75
  f'git clone https://github.com/s4afa451dgf415f/sd-webui-controlnet {params["dir"]}/extensions/sd-wi-controlnet',
76
  shell=True)
 
98
  subprocess.run(
99
  f'git clone https://github.com/hako-mikan/sd-webui-lora-block-weight {params["dir"]}/extensions/sd-wi-lora-block-weight',
100
  shell=True)
 
 
 
 
 
 
 
 
101
  end_time = time.time()
102
  print("已克隆git耗时:", end_time - start_time, "秒")
103
  def run_aria2c_download():
 
186
  start_time = time.time()
187
  # subprocess.run("pip install xformers xformers==0.0.20", shell=True)
188
  subprocess.run("pip install xformers==0.0.22.post4 --index-url https://download.pytorch.org/whl/cu121", shell=True)
189
+ # all in one和controlnet所需依赖
190
+ subprocess.run("pip install mediapipe svglib fvcore opencv-python>=4.8.0 PyExecJS pathos openai boto3 aliyun-python-sdk-core aliyun-python-sdk-alimt", shell=True)
191
+ for root, dirs, files in os.walk(f"{params['dir']}/extensions"):
192
+ print(f"{params['dir']}/extensions")
193
+ for file in files:
194
+ if file == 'install.py':
195
+ file_path = os.path.join(root, file)
196
+ os.remove(file_path)
197
+ print(f"Deleted {file_path}")
198
  # subprocess.run("pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2 torchtext==0.15.2+cpu torchdata==0.6.1 --index-url https://download.pytorch.org/whl/cu118", shell=True)
199
  end_time = time.time()
200
  print("pip完成下载耗时:", end_time - start_time, "秒")