gmk123 commited on
Commit
d333670
·
verified ·
1 Parent(s): eb9de50

Update comfyui_tmp.py

Browse files
Files changed (1) hide show
  1. comfyui_tmp.py +30 -30
comfyui_tmp.py CHANGED
@@ -4,39 +4,39 @@ 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/ComfyUI'#line:8
7
- def gitDownload (O0O00O0OO00OO0O0O ,OO00OOOO0O000O00O ):#line:11
8
- if os .path .exists (OO00OOOO0O000O00O ):#line:12
9
  return #line:13
10
- get_ipython ().system (f'git clone {O0O00O0OO00OO0O0O} {OO00OOOO0O000O00O}')#line:15
11
  def installAdditional ():#line:18
12
  get_ipython ().system (f'git clone --recursive https://github.com/ssitu/ComfyUI_UltimateSDUpscale {wb}/custom_nodes/ComfyUI_UltimateSDUpscale')#line:20
13
- OO0OO0000OO0OOO0O =['https://github.com/ltdrdata/ComfyUI-Manager','https://github.com/pythongosssss/ComfyUI-Custom-Scripts','https://github.com/city96/SD-Latent-Upscaler','https://github.com/jags111/efficiency-nodes-comfyui','https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb','https://github.com/ssitu/ComfyUI_NestedNodeBuilder','https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet','https://github.com/Fannovel16/comfyui_controlnet_aux','https://github.com/SLAPaper/ComfyUI-Image-Selector','https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes','https://github.com/FizzleDorf/ComfyUI_FizzNodes','https://github.com/WASasquatch/was-node-suite-comfyui','https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite','https://github.com/Gourieff/comfyui-reactor-node',]#line:38
14
- for O0OO0O0O0OOO00O0O in OO0OO0000OO0OOO0O :#line:39
15
- O00OO00O0OOOOO0O0 =O0OO0O0O0OOO00O0O .split ('/')[-1 ]#line:41
16
- if 'github'in O0OO0O0O0OOO00O0O :#line:43
17
- get_ipython ().system (f'git clone --depth 1 {O0OO0O0O0OOO00O0O} {wb}/custom_nodes/{O00OO00O0OOOOO0O0}')#line:44
18
  get_ipython ().system (f'wget https://huggingface.co/pantat88/ui/resolve/main/embeddings.zip -O {wb}/models/embeddings/embeddings.zip')#line:47
19
  get_ipython ().system (f'wget https://civitai.com/api/download/models/150491 -O {wb}/models/embeddings/edgQuality.pt')#line:48
20
  clear_output ()#line:50
21
  import subprocess #line:52
22
  def sync_tmp_folder ():#line:54
23
- OO0O0O0OOOO000O00 =[['rm','-rf','~/tmp/*','~/tmp','~/ComfyUI/models/checkpoints','~/ComfyUI/models/loras','~/ComfyUI/models/controlnet'],['ln','-vs','/tmp','~/tmp'],['ln','-vs','/tmp/models','~/ComfyUI/models/checkpoints'],['ln','-vs','/tmp/Lora','~/ComfyUI/models/loras'],['ln','-vs','/tmp/ControlNet','~/ComfyUI/models/controlnet'],['unzip','-o','~/ComfyUI/models/embeddings.zip','-d','~/ComfyUI/models/embeddings'],['rm','~/ComfyUI/models/embeddings.zip']]#line:63
24
- for O000OO000O0O0O0O0 in OO0O0O0OOOO000O00 :#line:64
25
- OO00000O0000O00OO =[os .path .expanduser (O0O000O00OOO0O0OO )for O0O000O00OOO0O0OO in O000OO000O0O0O0O0 ]#line:65
26
- subprocess .run (OO00000O0000O00OO ,check =True )#line:66
27
- def run_command (OOOO000OO0O00O00O ,OO0OOOOOO0O00OO00 ):#line:69
28
- print (f"Please wait, {OO0OOOOOO0O00OO00} is loading...")#line:70
29
- subprocess .run (OOOO000OO0O00O00O ,shell =True ,stdout =subprocess .DEVNULL ,stderr =subprocess .DEVNULL )#line:71
30
- print (f"{OO0OOOOOO0O00OO00} ok!")#line:72
31
  def zrok ():#line:75
32
  try :#line:76
33
- O0OOOOOOOOOO00OOO ="/home/studio-lab-user/.zrok/bin"#line:77
34
- os .makedirs (O0OOOOOOOOOO00OOO ,exist_ok =True )#line:78
35
  subprocess .run (["curl","-sLO","https://github.com/openziti/zrok/releases/download/v0.4.23/zrok_0.4.23_linux_amd64.tar.gz"],check =True )#line:79
36
- subprocess .run (["tar","-xzf","zrok_0.4.23_linux_amd64.tar.gz","-C",O0OOOOOOOOOO00OOO ,"--wildcards","*zrok"],check =True )#line:80
37
  os .remove ("zrok_0.4.23_linux_amd64.tar.gz")#line:81
38
- except Exception as OO000O0000OOOOOO0 :#line:83
39
- print (f"An error occurred: {OO000O0000OOOOOO0}")#line:84
40
  def initLocal ():#line:88
41
  run_command ('conda install -y conda glib gxx_linux-64 ffmpeg imageio imageio-ffmpeg av gst-libav psutil pyngrok gperftools aria2 gdown','【 Installing Conda 】')#line:90
42
  run_command ('conda install -y -n base python=3.10.12','【 Installing Python 3.10 】')#line:91
@@ -44,10 +44,10 @@ def initLocal ():#line:88
44
  get_ipython ().system ('pip install -q tqdm')#line:96
45
  clear_output ()#line:98
46
  get_ipython ().run_line_magic ('cd','/home/studio-lab-user')#line:99
47
- with capture .capture_output ()as OOOO000OO0000OO00 :#line:102
48
- def OO0O000OO000O0OO0 (O0O0O00O00000000O ,OO0OO0OO0OOO00OOO ,OOO000000O0O0O0O0 ):O00OO000O0O0000O0 =widgets .Button (description =O0O0O00O00000000O ,disabled =True ,button_style =OO0OO0OO0OOO00OOO ,layout =widgets .Layout (min_width =OOO000000O0O0O0O0 ));display (O00OO000O0O0000O0 )#line:103
49
  get_ipython ().system (f'git clone -q https://github.com/comfyanonymous/ComfyUI {wb}')#line:105
50
- with capture .capture_output ()as OOOO000OO0000OO00 :#line:107
51
  get_ipython ().run_line_magic ('cd',f'{wb}')#line:108
52
  get_ipython ().system ("pip install -q https://download.pytorch.org/whl/cu118/xformers-0.0.22.post4%2Bcu118-cp310-cp310-manylinux2014_x86_64.whl -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118")#line:110
53
  get_ipython ().system ('pip install -q -r requirements.txt')#line:111
@@ -58,8 +58,8 @@ def initLocal ():#line:88
58
  get_ipython ().system (f'pip install -q basicsr')#line:119
59
  clear_output ()#line:121
60
  zrok ()#line:125
61
- get_ipython ().system (f'wget https://huggingface.co/gmk123/run/raw/main/zrun.py -O {wb}/zrun.py')#line:126
62
- get_ipython ().system (f'wget https://huggingface.co/gmk123/run/raw/main/zrok.py -O {wb}/zrok.py')#line:127
63
  installAdditional ()#line:130
64
  sync_tmp_folder ()#line:133
65
  clear_output ()#line:140
@@ -75,15 +75,15 @@ def initLocal ():#line:88
75
  wise ="--xformers --enable-insecure-extension-access --theme dark --disable-console-progressbars --upcast-sampling"#line:155
76
  ngrok_token =os .environ .get ('NGROK_TOKEN')#line:158
77
  wise +=f" --ngrok {ngrok_token}"#line:159
78
- def run (OO0O0OOOOO00O0O0O ):#line:162
79
  clear_output ()#line:163
80
  print (f'建议使用第二步:zrok部署,无需魔法,没有流量限制')#line:164
81
  print (f'Ngrok注意事项:每个账号每月1G流量!需配合魔法使用')#line:165
82
  get_ipython ().system (f'mkdir -p /tmp/ControlNet')#line:166
83
  get_ipython ().run_line_magic ('cd',f'{wb}')#line:168
84
- get_ipython ().system (f'python {OO0O0OOOOO00O0O0O} {wise}')#line:169
85
  if os .path .exists (f'{wb}'):#line:172
86
- run (f'webui.py')#line:174
87
  else :#line:175
88
  initLocal ()#line:177
89
- run (f'launch.py')#line:180
 
4
  from IPython .utils import capture #line:4
5
  from IPython .display import clear_output #line:5
6
  wb =f'/home/studio-lab-user/ComfyUI'#line:8
7
+ def gitDownload (O000O0OO0O0OOOOO0 ,O00O0OOO00O0O0O0O ):#line:11
8
+ if os .path .exists (O00O0OOO00O0O0O0O ):#line:12
9
  return #line:13
10
+ get_ipython ().system (f'git clone {O000O0OO0O0OOOOO0} {O00O0OOO00O0O0O0O}')#line:15
11
  def installAdditional ():#line:18
12
  get_ipython ().system (f'git clone --recursive https://github.com/ssitu/ComfyUI_UltimateSDUpscale {wb}/custom_nodes/ComfyUI_UltimateSDUpscale')#line:20
13
+ O0OOOOOOO0O00OO0O =['https://github.com/ltdrdata/ComfyUI-Manager','https://github.com/pythongosssss/ComfyUI-Custom-Scripts','https://github.com/city96/SD-Latent-Upscaler','https://github.com/jags111/efficiency-nodes-comfyui','https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb','https://github.com/ssitu/ComfyUI_NestedNodeBuilder','https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet','https://github.com/Fannovel16/comfyui_controlnet_aux','https://github.com/SLAPaper/ComfyUI-Image-Selector','https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes','https://github.com/FizzleDorf/ComfyUI_FizzNodes','https://github.com/WASasquatch/was-node-suite-comfyui','https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite','https://github.com/Gourieff/comfyui-reactor-node',]#line:38
14
+ for O0O0O0000OOOOOO00 in O0OOOOOOO0O00OO0O :#line:39
15
+ OOO00OOO0OO0OOOOO =O0O0O0000OOOOOO00 .split ('/')[-1 ]#line:41
16
+ if 'github'in O0O0O0000OOOOOO00 :#line:43
17
+ get_ipython ().system (f'git clone --depth 1 {O0O0O0000OOOOOO00} {wb}/custom_nodes/{OOO00OOO0OO0OOOOO}')#line:44
18
  get_ipython ().system (f'wget https://huggingface.co/pantat88/ui/resolve/main/embeddings.zip -O {wb}/models/embeddings/embeddings.zip')#line:47
19
  get_ipython ().system (f'wget https://civitai.com/api/download/models/150491 -O {wb}/models/embeddings/edgQuality.pt')#line:48
20
  clear_output ()#line:50
21
  import subprocess #line:52
22
  def sync_tmp_folder ():#line:54
23
+ OO000OOOO00OO0OO0 =[['rm','-rf','~/tmp/*','~/tmp','~/ComfyUI/models/checkpoints','~/ComfyUI/models/loras','~/ComfyUI/models/controlnet'],['ln','-vs','/tmp','~/tmp'],['ln','-vs','/tmp/models','~/ComfyUI/models/checkpoints'],['ln','-vs','/tmp/Lora','~/ComfyUI/models/loras'],['ln','-vs','/tmp/ControlNet','~/ComfyUI/models/controlnet'],['unzip','-o','~/ComfyUI/models/embeddings.zip','-d','~/ComfyUI/models/embeddings'],['rm','~/ComfyUI/models/embeddings.zip']]#line:63
24
+ for OOO0O0OO000000O0O in OO000OOOO00OO0OO0 :#line:64
25
+ OOO0O0OOO0000O0O0 =[os .path .expanduser (OO00000O00OO000O0 )for OO00000O00OO000O0 in OOO0O0OO000000O0O ]#line:65
26
+ subprocess .run (OOO0O0OOO0000O0O0 ,check =True )#line:66
27
+ def run_command (OOO0OOO0O0O0O00O0 ,O0O00OOO00000O0O0 ):#line:69
28
+ print (f"Please wait, {O0O00OOO00000O0O0} is loading...")#line:70
29
+ subprocess .run (OOO0OOO0O0O0O00O0 ,shell =True ,stdout =subprocess .DEVNULL ,stderr =subprocess .DEVNULL )#line:71
30
+ print (f"{O0O00OOO00000O0O0} ok!")#line:72
31
  def zrok ():#line:75
32
  try :#line:76
33
+ O00OOOO0OO000OO00 ="/home/studio-lab-user/.zrok/bin"#line:77
34
+ os .makedirs (O00OOOO0OO000OO00 ,exist_ok =True )#line:78
35
  subprocess .run (["curl","-sLO","https://github.com/openziti/zrok/releases/download/v0.4.23/zrok_0.4.23_linux_amd64.tar.gz"],check =True )#line:79
36
+ subprocess .run (["tar","-xzf","zrok_0.4.23_linux_amd64.tar.gz","-C",O00OOOO0OO000OO00 ,"--wildcards","*zrok"],check =True )#line:80
37
  os .remove ("zrok_0.4.23_linux_amd64.tar.gz")#line:81
38
+ except Exception as O0O00OO00000OOOO0 :#line:83
39
+ print (f"An error occurred: {O0O00OO00000OOOO0}")#line:84
40
  def initLocal ():#line:88
41
  run_command ('conda install -y conda glib gxx_linux-64 ffmpeg imageio imageio-ffmpeg av gst-libav psutil pyngrok gperftools aria2 gdown','【 Installing Conda 】')#line:90
42
  run_command ('conda install -y -n base python=3.10.12','【 Installing Python 3.10 】')#line:91
 
44
  get_ipython ().system ('pip install -q tqdm')#line:96
45
  clear_output ()#line:98
46
  get_ipython ().run_line_magic ('cd','/home/studio-lab-user')#line:99
47
+ with capture .capture_output ()as OO0OO0OOO00OOOOO0 :#line:102
48
+ def OO000O0O0OO00000O (OOOOOO0O000O0O00O ,OO0O0O00OOOO00OOO ,O000OO00OOOOO0OO0 ):O00O00000O00O0O00 =widgets .Button (description =OOOOOO0O000O0O00O ,disabled =True ,button_style =OO0O0O00OOOO00OOO ,layout =widgets .Layout (min_width =O000OO00OOOOO0OO0 ));display (O00O00000O00O0O00 )#line:103
49
  get_ipython ().system (f'git clone -q https://github.com/comfyanonymous/ComfyUI {wb}')#line:105
50
+ with capture .capture_output ()as OO0OO0OOO00OOOOO0 :#line:107
51
  get_ipython ().run_line_magic ('cd',f'{wb}')#line:108
52
  get_ipython ().system ("pip install -q https://download.pytorch.org/whl/cu118/xformers-0.0.22.post4%2Bcu118-cp310-cp310-manylinux2014_x86_64.whl -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118")#line:110
53
  get_ipython ().system ('pip install -q -r requirements.txt')#line:111
 
58
  get_ipython ().system (f'pip install -q basicsr')#line:119
59
  clear_output ()#line:121
60
  zrok ()#line:125
61
+ get_ipython ().system (f'wget https://huggingface.co/gmk123/comfyui/raw/main/zrun.py -O {wb}/zrun.py')#line:126
62
+ get_ipython ().system (f'wget https://huggingface.co/gmk123/comfyui/raw/main/zrok.py -O {wb}/zrok.py')#line:127
63
  installAdditional ()#line:130
64
  sync_tmp_folder ()#line:133
65
  clear_output ()#line:140
 
75
  wise ="--xformers --enable-insecure-extension-access --theme dark --disable-console-progressbars --upcast-sampling"#line:155
76
  ngrok_token =os .environ .get ('NGROK_TOKEN')#line:158
77
  wise +=f" --ngrok {ngrok_token}"#line:159
78
+ def run (OOO00OO0000000O00 ):#line:162
79
  clear_output ()#line:163
80
  print (f'建议使用第二步:zrok部署,无需魔法,没有流量限制')#line:164
81
  print (f'Ngrok注意事项:每个账号每月1G流量!需配合魔法使用')#line:165
82
  get_ipython ().system (f'mkdir -p /tmp/ControlNet')#line:166
83
  get_ipython ().run_line_magic ('cd',f'{wb}')#line:168
84
+ get_ipython ().system (f'python {OOO00OO0000000O00} {wise}')#line:169
85
  if os .path .exists (f'{wb}'):#line:172
86
+ run (f'main.py')#line:174
87
  else :#line:175
88
  initLocal ()#line:177
89
+ run (f'main.py')#line:180