gmk123 commited on
Commit
2394893
·
verified ·
1 Parent(s): 71fc0da

Update sagemaker.py

Browse files
Files changed (1) hide show
  1. sagemaker.py +20 -19
sagemaker.py CHANGED
@@ -4,16 +4,16 @@ from IPython import get_ipython #line:3
4
  from IPython .utils import capture #line:4
5
  from IPython .display import clear_output #line:5
6
  wb =f'/home/studio-lab-user/stable-diffusion-webui'#line:8
7
- def gitDownload (O00O0O0OOO0OOO0OO ,O00O0000O0O000OOO ):#line:11
8
- if os .path .exists (O00O0000O0O000OOO ):#line:12
9
  return #line:13
10
- get_ipython ().system (f'git clone {O00O0O0OOO0OOO0OO} {O00O0000O0O000OOO}')#line:15
11
  def installAdditional ():#line:18
12
- OOO0O0OO0000O00O0 =[f'https://github.com/AlUlkesh/stable-diffusion-webui-images-browser',f'https://github.com/etherealxx/batchlinks-webui',f'https://github.com/camenduru/sd-civitai-browser',f'https://github.com/thomasasfk/sd-webui-aspect-ratio-helper',f'https://github.com/kohya-ss/sd-webui-additional-networks',f'https://github.com/fkunn1326/openpose-editor',f'https://github.com/nonnonstop/sd-webui-3d-open-pose-editor',f'https://github.com/Physton/sd-webui-prompt-all-in-one',f'https://github.com/Bing-su/adetailer',f'https://github.com/picobyte/stable-diffusion-webui-wd14-tagger',f'https://github.com/Mikubill/sd-webui-controlnet',f'https://github.com/IDEA-Research/DWPose',f'https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans',f'https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111',]#line:58
13
- for OO0OOOOO00O0OO000 in OOO0O0OO0000O00O0 :#line:59
14
- OOOO0OOO00O00O0OO =OO0OOOOO00O0OO000 .split ('/')[-1 ]#line:61
15
- if 'github'in OO0OOOOO00O0OO000 :#line:63
16
- get_ipython ().system (f'git clone --depth 1 {OO0OOOOO00O0OO000} {wb}/extensions/{OOOO0OOO00O00O0OO}')#line:64
17
  get_ipython ().system (f'wget https://raw.githubuserhome/studio-lab-user.com/camenduru/stable-diffusion-webui-scripts/main/run_n_times.py -O {wb}/scripts/run_n_times.py')#line:66
18
  clear_output ()#line:68
19
  gitDownload (f'https://huggingface.co/embed/negative',f'{wb}/embeddings/negative')#line:70
@@ -32,14 +32,14 @@ def installAdditional ():#line:18
32
  print ('Roop换脸启用')#line:88
33
  import subprocess #line:90
34
  def sync_tmp_folder ():#line:92
35
- OO0O0OO00OOO0OOOO =[['rm','-rf','~/tmp/*','~/tmp','~/stable-diffusion-webui/models/Stable-diffusion/tmp_models','~/stable-diffusion-webui/models/ControlNet'],['ln','-vs','/tmp','~/tmp'],['ln','-vs','/tmp/models','~/stable-diffusion-webui/models/Stable-diffusion/tmp_models'],['ln','-vs','/tmp/ControlNet','~/stable-diffusion-webui/models/ControlNet']]#line:98
36
- for OO0OO00OO0OOO0000 in OO0O0OO00OOO0OOOO :#line:100
37
- OOO00000OO0000O00 =[os .path .expanduser (OOO00OO0OO000000O )for OOO00OO0OO000000O in OO0OO00OO0OOO0000 ]#line:101
38
- subprocess .run (OOO00000OO0000O00 ,check =True )#line:102
39
- def run_command (O0000OOOO0OOOO0OO ,O000O0O0OO0O0OO00 ):#line:104
40
- print (f"Please wait, {O000O0O0OO0O0OO00} is loading...")#line:105
41
- subprocess .run (O0000OOOO0OOOO0OO ,shell =True ,stdout =subprocess .DEVNULL ,stderr =subprocess .DEVNULL )#line:106
42
- print (f"{O000O0O0OO0O0OO00} ok!")#line:107
43
  def initLocal ():#line:110
44
  run_command ('conda install -y conda glib psutil gperftools aria2 gdown wget','【 Installing Conda 】')#line:112
45
  run_command ('conda install -y -n base python=3.10.12','【 Installing Python 3.10 】')#line:113
@@ -50,9 +50,10 @@ def initLocal ():#line:110
50
  clear_output ()#line:120
51
  get_ipython ().run_line_magic ('cd','/home/studio-lab-user')#line:121
52
  get_ipython ().system (f'git clone -q --branch master https://github.com/AUTOMATIC1111/stable-diffusion-webui {wb}')#line:124
53
- get_ipython ().system ('pip install -q -r requirements.txt basicsr')#line:127
54
  sync_tmp_folder ()#line:130
55
  clear_output ()#line:132
 
56
  get_ipython ().system (f'pip install -q fake_useragent')#line:138
57
  installAdditional ()#line:143
58
  get_ipython ().system (f'rm -rf {wb}/config.json')#line:146
@@ -65,14 +66,14 @@ def initLocal ():#line:110
65
  wise ="--listen --api --enable-insecure-extension-access --xformers --theme dark --gradio-queue --disable-console-progressbars --upcast-sampling --skip-version-check"#line:158
66
  ngrok_token =os .environ .get ('NGROK_TOKEN')#line:161
67
  wise +=f" --ngrok {ngrok_token}"#line:162
68
- def run (OO000O00OOO0O0O00 ):#line:165
69
  clear_output ()#line:166
70
  print (f'Ngrok内网令牌:{ngrok_token}')#line:167
71
  print (f'Ngrok注意事项:每个账号每月1G流量!!!请留意后台剩余流量。')#line:168
72
  print (f'Ngrok剩余流量:点击查看 -- https://dashboard.ngrok.com/usage')#line:169
73
  get_ipython ().system (f'mkdir -p /tmp/ControlNet')#line:170
74
  get_ipython ().run_line_magic ('cd',f'{wb}')#line:172
75
- get_ipython ().system (f'python {OO000O00OOO0O0O00} {wise}')#line:173
76
  if os .path .exists (f'{wb}'):#line:176
77
  run (f'webui.py')#line:178
78
  else :#line:179
 
4
  from IPython .utils import capture #line:4
5
  from IPython .display import clear_output #line:5
6
  wb =f'/home/studio-lab-user/stable-diffusion-webui'#line:8
7
+ def gitDownload (O0O00O0000OOOOOO0 ,OOOO0O00O00OOOOO0 ):#line:11
8
+ if os .path .exists (OOOO0O00O00OOOOO0 ):#line:12
9
  return #line:13
10
+ get_ipython ().system (f'git clone {O0O00O0000OOOOOO0} {OOOO0O00O00OOOOO0}')#line:15
11
  def installAdditional ():#line:18
12
+ O0OOO00OOO00O0000 =[f'https://github.com/AlUlkesh/stable-diffusion-webui-images-browser',f'https://github.com/etherealxx/batchlinks-webui',f'https://github.com/camenduru/sd-civitai-browser',f'https://github.com/thomasasfk/sd-webui-aspect-ratio-helper',f'https://github.com/kohya-ss/sd-webui-additional-networks',f'https://github.com/fkunn1326/openpose-editor',f'https://github.com/nonnonstop/sd-webui-3d-open-pose-editor',f'https://github.com/Physton/sd-webui-prompt-all-in-one',f'https://github.com/Bing-su/adetailer',f'https://github.com/picobyte/stable-diffusion-webui-wd14-tagger',f'https://github.com/Mikubill/sd-webui-controlnet',f'https://github.com/IDEA-Research/DWPose',f'https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans',f'https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111',]#line:58
13
+ for O0OO0OO0OOO0000O0 in O0OOO00OOO00O0000 :#line:59
14
+ OOO0000OO00O00O00 =O0OO0OO0OOO0000O0 .split ('/')[-1 ]#line:61
15
+ if 'github'in O0OO0OO0OOO0000O0 :#line:63
16
+ get_ipython ().system (f'git clone --depth 1 {O0OO0OO0OOO0000O0} {wb}/extensions/{OOO0000OO00O00O00}')#line:64
17
  get_ipython ().system (f'wget https://raw.githubuserhome/studio-lab-user.com/camenduru/stable-diffusion-webui-scripts/main/run_n_times.py -O {wb}/scripts/run_n_times.py')#line:66
18
  clear_output ()#line:68
19
  gitDownload (f'https://huggingface.co/embed/negative',f'{wb}/embeddings/negative')#line:70
 
32
  print ('Roop换脸启用')#line:88
33
  import subprocess #line:90
34
  def sync_tmp_folder ():#line:92
35
+ O000OOO0O0O0000O0 =[['rm','-rf','~/tmp/*','~/tmp','~/stable-diffusion-webui/models/Stable-diffusion/tmp_models','~/stable-diffusion-webui/models/ControlNet'],['ln','-vs','/tmp','~/tmp'],['ln','-vs','/tmp/models','~/stable-diffusion-webui/models/Stable-diffusion/tmp_models'],['ln','-vs','/tmp/ControlNet','~/stable-diffusion-webui/models/ControlNet']]#line:98
36
+ for OOOOOO0O0O00OO00O in O000OOO0O0O0000O0 :#line:100
37
+ OO0OO00000OOO0O0O =[os .path .expanduser (O00O0O0OO00OO00OO )for O00O0O0OO00OO00OO in OOOOOO0O0O00OO00O ]#line:101
38
+ subprocess .run (OO0OO00000OOO0O0O ,check =True )#line:102
39
+ def run_command (O00O000OO0O0OOOO0 ,O000OOO0OOO0OOOO0 ):#line:104
40
+ print (f"Please wait, {O000OOO0OOO0OOOO0} is loading...")#line:105
41
+ subprocess .run (O00O000OO0O0OOOO0 ,shell =True ,stdout =subprocess .DEVNULL ,stderr =subprocess .DEVNULL )#line:106
42
+ print (f"{O000OOO0OOO0OOOO0} ok!")#line:107
43
  def initLocal ():#line:110
44
  run_command ('conda install -y conda glib psutil gperftools aria2 gdown wget','【 Installing Conda 】')#line:112
45
  run_command ('conda install -y -n base python=3.10.12','【 Installing Python 3.10 】')#line:113
 
50
  clear_output ()#line:120
51
  get_ipython ().run_line_magic ('cd','/home/studio-lab-user')#line:121
52
  get_ipython ().system (f'git clone -q --branch master https://github.com/AUTOMATIC1111/stable-diffusion-webui {wb}')#line:124
53
+ get_ipython ().system ('pip install -q -r requirements.txt')#line:127
54
  sync_tmp_folder ()#line:130
55
  clear_output ()#line:132
56
+ get_ipython ().system (f'pip install -q basicsr')#line:137
57
  get_ipython ().system (f'pip install -q fake_useragent')#line:138
58
  installAdditional ()#line:143
59
  get_ipython ().system (f'rm -rf {wb}/config.json')#line:146
 
66
  wise ="--listen --api --enable-insecure-extension-access --xformers --theme dark --gradio-queue --disable-console-progressbars --upcast-sampling --skip-version-check"#line:158
67
  ngrok_token =os .environ .get ('NGROK_TOKEN')#line:161
68
  wise +=f" --ngrok {ngrok_token}"#line:162
69
+ def run (OO0O000O0OO00O000 ):#line:165
70
  clear_output ()#line:166
71
  print (f'Ngrok内网令牌:{ngrok_token}')#line:167
72
  print (f'Ngrok注意事项:每个账号每月1G流量!!!请留意后台剩余流量。')#line:168
73
  print (f'Ngrok剩余流量:点击查看 -- https://dashboard.ngrok.com/usage')#line:169
74
  get_ipython ().system (f'mkdir -p /tmp/ControlNet')#line:170
75
  get_ipython ().run_line_magic ('cd',f'{wb}')#line:172
76
+ get_ipython ().system (f'python {OO0O000O0OO00O000} {wise}')#line:173
77
  if os .path .exists (f'{wb}'):#line:176
78
  run (f'webui.py')#line:178
79
  else :#line:179