TheLastBen commited on
Commit
79e12cf
1 Parent(s): 827d95a

Upload 4 files

Browse files
Scripts/mainpaperspaceA1111.py CHANGED
@@ -51,6 +51,7 @@ def Deps(force_reinstall):
51
  os.environ['TORCH_HOME'] = '/notebooks/cache/torch'
52
  os.environ['PYTHONWARNINGS'] = 'ignore'
53
  call("sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.9/warnings.py", shell=True)
 
54
  if not os.path.exists('/notebooks/diffusers'):
55
  call('ln -s /diffusers /notebooks', shell=True)
56
  call("rm -r /deps", shell=True)
@@ -162,6 +163,7 @@ def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage):
162
  call('ln -s /datasets/stable-diffusion-classic/SDv1.5.ckpt /notebooks/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
163
  call('ln -s /datasets/stable-diffusion-v2-1-base-diffusers/stable-diffusion-2-1-base/v2-1_512-nonema-pruned.safetensors /notebooks/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
164
  call('ln -s /datasets/stable-diffusion-v2-1/stable-diffusion-2-1/v2-1_768-nonema-pruned.safetensors /notebooks/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
 
165
 
166
  if Path_to_MODEL !='':
167
  if os.path.exists(str(Path_to_MODEL)):
@@ -214,22 +216,17 @@ def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage):
214
 
215
  else:
216
  if Original_Model_Version == "v1.5":
217
- model="/datasets/stable-diffusion-classic/SDv1.5.ckpt"
218
  print('Using the original V1.5 model')
219
  elif Original_Model_Version == "v2-512":
220
- model="/datasets/stable-diffusion-v2-1-base-diffusers/stable-diffusion-2-1-base/v2-1_512-nonema-pruned.safetensors"
221
  print('Using the original V2-512 model')
222
  elif Original_Model_Version == "v2-768":
223
- model="/datasets/stable-diffusion-v2-1/stable-diffusion-2-1/v2-1_768-nonema-pruned.safetensors"
224
  print('Using the original V2-768 model')
225
  elif Original_Model_Version == "SDXL":
226
  model="/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors"
227
- if not os.path.exists('/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors'):
228
- print('Downloading SDXL...')
229
- call('gdown -O '+model+' https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors', shell=True)
230
- clear_output()
231
  print('Using the original SDXL model')
232
-
233
  else:
234
  model="/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion"
235
  print('Wrong model version, try again')
 
51
  os.environ['TORCH_HOME'] = '/notebooks/cache/torch'
52
  os.environ['PYTHONWARNINGS'] = 'ignore'
53
  call("sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.9/warnings.py", shell=True)
54
+ #call('pip install --root-user-action=ignore --disable-pip-version-check -qq gradio==3.39.0', shell=True, stdout=open('/dev/null', 'w'))
55
  if not os.path.exists('/notebooks/diffusers'):
56
  call('ln -s /diffusers /notebooks', shell=True)
57
  call("rm -r /deps", shell=True)
 
163
  call('ln -s /datasets/stable-diffusion-classic/SDv1.5.ckpt /notebooks/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
164
  call('ln -s /datasets/stable-diffusion-v2-1-base-diffusers/stable-diffusion-2-1-base/v2-1_512-nonema-pruned.safetensors /notebooks/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
165
  call('ln -s /datasets/stable-diffusion-v2-1/stable-diffusion-2-1/v2-1_768-nonema-pruned.safetensors /notebooks/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
166
+ call('ln -s /datasets/stable-diffusion-xl/sd_xl_base_1.0.safetensors /notebooks/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
167
 
168
  if Path_to_MODEL !='':
169
  if os.path.exists(str(Path_to_MODEL)):
 
216
 
217
  else:
218
  if Original_Model_Version == "v1.5":
219
+ model="/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion/SDv1.5.ckpt"
220
  print('Using the original V1.5 model')
221
  elif Original_Model_Version == "v2-512":
222
+ model="/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion/v2-1_512-nonema-pruned.safetensors"
223
  print('Using the original V2-512 model')
224
  elif Original_Model_Version == "v2-768":
225
+ model="/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion/v2-1_768-nonema-pruned.safetensors"
226
  print('Using the original V2-768 model')
227
  elif Original_Model_Version == "SDXL":
228
  model="/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors"
 
 
 
 
229
  print('Using the original SDXL model')
 
230
  else:
231
  model="/notebooks/sd/stable-diffusion-webui/models/Stable-diffusion"
232
  print('Wrong model version, try again')
Scripts/mainpaperspacev1.py CHANGED
@@ -64,6 +64,7 @@ def Deps(force_reinstall):
64
  os.environ['TORCH_HOME'] = '/notebooks/cache/torch'
65
  os.environ['PYTHONWARNINGS'] = 'ignore'
66
  call("sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.9/warnings.py", shell=True)
 
67
  if not os.path.exists('/notebooks/diffusers'):
68
  call('ln -s /diffusers /notebooks', shell=True)
69
  call("rm -r /deps", shell=True)
 
64
  os.environ['TORCH_HOME'] = '/notebooks/cache/torch'
65
  os.environ['PYTHONWARNINGS'] = 'ignore'
66
  call("sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.9/warnings.py", shell=True)
67
+ #call('pip install --root-user-action=ignore --disable-pip-version-check -qq gradio==3.39.0', shell=True, stdout=open('/dev/null', 'w'))
68
  if not os.path.exists('/notebooks/diffusers'):
69
  call('ln -s /diffusers /notebooks', shell=True)
70
  call("rm -r /deps", shell=True)
Scripts/mainpaperspacev2.py CHANGED
@@ -65,6 +65,7 @@ def Deps(force_reinstall):
65
  os.environ['TORCH_HOME'] = '/notebooks/cache/torch'
66
  os.environ['PYTHONWARNINGS'] = 'ignore'
67
  call("sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.9/warnings.py", shell=True)
 
68
  if not os.path.exists('/notebooks/diffusers'):
69
  call('ln -s /diffusers /notebooks', shell=True)
70
  call("rm -r /deps", shell=True)
 
65
  os.environ['TORCH_HOME'] = '/notebooks/cache/torch'
66
  os.environ['PYTHONWARNINGS'] = 'ignore'
67
  call("sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.9/warnings.py", shell=True)
68
+ #call('pip install --root-user-action=ignore --disable-pip-version-check -qq gradio==3.39.0', shell=True, stdout=open('/dev/null', 'w'))
69
  if not os.path.exists('/notebooks/diffusers'):
70
  call('ln -s /diffusers /notebooks', shell=True)
71
  call("rm -r /deps", shell=True)
Scripts/sdxllorapps.py CHANGED
@@ -732,26 +732,15 @@ def sdcmf(MDLPTH, Download_SDXL_Model):
732
  if os.path.exists(MDLPTH):
733
  call('ln -s '+MDLPTH+' models/loras', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
734
 
735
- if Download_SDXL_Model and not os.path.exists('/notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors'):
736
- mdllnk= 'https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors'
737
- dwn(mdllnk, '/notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors','Downloading the Model')
738
- if not os.path.exists('models/checkpoints/sd_xl_base_1.0.safetensors'):
739
- call('ln -s /notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors models/checkpoints', shell=True)
740
-
741
- elif Download_SDXL_Model and os.path.exists('/notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors'):
742
- if not os.path.exists('models/checkpoints/sd_xl_base_1.0.safetensors'):
743
- call('ln -s /notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors models/checkpoints', shell=True)
744
- print('Model already exists, skipping download...')
745
-
746
 
747
  localurl="https://tensorboard-"+os.environ.get('PAPERSPACE_FQDN')
748
  call("sed -i 's@print(\"To see the GUI go to: http://{}:{}\".format(address, port))@print(\"\u2714 Connected\")\\n print(\""+localurl+"\")@' /notebooks/ComfyUI/server.py", shell=True)
749
  os.chdir('/notebooks')
750
 
751
 
752
-
753
-
754
- def test(MDLPTH, User, Password, Download_SDXL_Model):
755
 
756
 
757
  auth=f"--gradio-auth {User}:{Password}"
@@ -776,22 +765,9 @@ def test(MDLPTH, User, Password, Download_SDXL_Model):
776
  clear_output()
777
 
778
 
779
- if os.path.exists(MDLPTH):
780
- call('mkdir models/Lora', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
781
- call('ln -s '+MDLPTH+' models/Lora', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
782
-
783
- if Download_SDXL_Model and not os.path.exists('/notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors'):
784
- mdllnk= 'https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors'
785
- dwn(mdllnk, '/notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors','Downloading the Model')
786
- if not os.path.exists('models/Stable-diffusion/sd_xl_base_1.0.safetensors'):
787
- call('ln -s /notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors models/Stable-diffusion', shell=True)
788
-
789
- elif Download_SDXL_Model and os.path.exists('/notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors'):
790
- if not os.path.exists('models/Stable-diffusion/sd_xl_base_1.0.safetensors'):
791
- call('ln -s /notebooks/Fast-Dreambooth/sd_xl_base_1.0.safetensors models/Stable-diffusion', shell=True)
792
- print('Model already exists, skipping download...')
793
-
794
-
795
 
796
  call('wget -q -O /usr/local/lib/python3.9/dist-packages/gradio/blocks.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/AUTOMATIC1111_files/blocks.py', shell=True)
797
 
 
732
  if os.path.exists(MDLPTH):
733
  call('ln -s '+MDLPTH+' models/loras', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
734
 
735
+ if not os.path.exists('models/checkpoints/sd_xl_base_1.0.safetensors'):
736
+ call('ln -s /datasets/stable-diffusion-xl/sd_xl_base_1.0.safetensors models/checkpoints', shell=True)
 
 
 
 
 
 
 
 
 
737
 
738
  localurl="https://tensorboard-"+os.environ.get('PAPERSPACE_FQDN')
739
  call("sed -i 's@print(\"To see the GUI go to: http://{}:{}\".format(address, port))@print(\"\u2714 Connected\")\\n print(\""+localurl+"\")@' /notebooks/ComfyUI/server.py", shell=True)
740
  os.chdir('/notebooks')
741
 
742
 
743
+ def test(MDLPTH, User, Password):
 
 
744
 
745
 
746
  auth=f"--gradio-auth {User}:{Password}"
 
765
  clear_output()
766
 
767
 
768
+ if not os.path.exists('models/Stable-diffusion/sd_xl_base_1.0.safetensors'):
769
+ call('ln -s /datasets/stable-diffusion-xl/sd_xl_base_1.0.safetensors models/Stable-diffusion', shell=True)
770
+
 
 
 
 
 
 
 
 
 
 
 
 
 
771
 
772
  call('wget -q -O /usr/local/lib/python3.9/dist-packages/gradio/blocks.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/AUTOMATIC1111_files/blocks.py', shell=True)
773