TheLastBen
commited on
Commit
·
2aa3c54
1
Parent(s):
152e69f
Update mainpaperspacev1.py
Browse files- mainpaperspacev1.py +24 -21
mainpaperspacev1.py
CHANGED
@@ -720,31 +720,32 @@ def test(Custom_Path, Previous_Session_Name, Session_Name, User, Password, Use_l
|
|
720 |
auth=""
|
721 |
|
722 |
os.chdir('/notebooks')
|
723 |
-
if not os.path.exists('
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
|
|
|
|
729 |
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
call('git clone -q --depth 1 --branch master https://github.com/crowsonkb/k-diffusion', shell=True)
|
737 |
|
738 |
if not os.path.exists('/usr/lib/node_modules/localtunnel'):
|
739 |
call('npm install -g localtunnel --silent', shell=True, stdout=open('/dev/null', 'w'))
|
740 |
|
741 |
share=''
|
|
|
|
|
742 |
if not Use_localtunnel:
|
743 |
-
share='--share'
|
744 |
-
call('wget -q -O /usr/local/lib/python3.9/dist-packages/gradio/blocks.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dreambooth/blocks.py', shell=True)
|
745 |
|
746 |
else:
|
747 |
-
|
748 |
share=''
|
749 |
os.chdir('/notebooks')
|
750 |
call('nohup lt --port 7860 > srv.txt 2>&1 &', shell=True)
|
@@ -771,13 +772,15 @@ def test(Custom_Path, Previous_Session_Name, Session_Name, User, Password, Use_l
|
|
771 |
|
772 |
|
773 |
|
774 |
-
os.chdir('/notebooks/
|
775 |
-
|
776 |
-
call('
|
777 |
-
|
778 |
clear_output()
|
|
|
|
|
779 |
|
780 |
-
return
|
781 |
|
782 |
|
783 |
|
|
|
720 |
auth=""
|
721 |
|
722 |
os.chdir('/notebooks')
|
723 |
+
if not os.path.exists('/notebooks/sd/stablediffusion'):
|
724 |
+
call('wget -q -O sd_kg.tar.zst https://huggingface.co/TheLastBen/dependencies/resolve/main/sd_kg.tar.zst', shell=True)
|
725 |
+
call('tar --zstd -xf sd_kg.tar.zst', shell=True)
|
726 |
+
call('rm sd_kg.tar.zst', shell=True)
|
727 |
+
|
728 |
+
os.chdir('/notebooks/sd')
|
729 |
+
if not os.path.exists('stable-diffusion-webui'):
|
730 |
+
call('git clone -q --depth 1 --branch master https://github.com/AUTOMATIC1111/stable-diffusion-webui', shell=True)
|
731 |
|
732 |
+
os.chdir('/notebooks/sd/stable-diffusion-webui/')
|
733 |
+
call('git reset --hard', shell=True, stdout=open('/dev/null', 'w'))
|
734 |
+
print('[1;32m')
|
735 |
+
call('git pull', shell=True, stdout=open('/dev/null', 'w'))
|
736 |
+
os.chdir('/notebooks')
|
737 |
+
clear_output()
|
|
|
738 |
|
739 |
if not os.path.exists('/usr/lib/node_modules/localtunnel'):
|
740 |
call('npm install -g localtunnel --silent', shell=True, stdout=open('/dev/null', 'w'))
|
741 |
|
742 |
share=''
|
743 |
+
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)
|
744 |
+
|
745 |
if not Use_localtunnel:
|
746 |
+
share='--share'
|
|
|
747 |
|
748 |
else:
|
|
|
749 |
share=''
|
750 |
os.chdir('/notebooks')
|
751 |
call('nohup lt --port 7860 > srv.txt 2>&1 &', shell=True)
|
|
|
772 |
|
773 |
|
774 |
|
775 |
+
os.chdir('/notebooks/sd/stable-diffusion-webui/modules')
|
776 |
+
call('wget -q -O paths.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/AUTOMATIC1111_files/paths.py', shell=True)
|
777 |
+
call("sed -i 's@/content/gdrive/MyDrive/sd/stablediffusion@/notebooks/sd/stablediffusion@' /notebooks/sd/stable-diffusion-webui/modules/paths.py", shell=True)
|
778 |
+
os.chdir('/notebooks/sd/stable-diffusion-webui')
|
779 |
clear_output()
|
780 |
+
|
781 |
+
configf="--disable-console-progressbars --no-half-vae --disable-safe-unpickle --api --xformers --medvram --skip-version-check --ckpt "+path_to_trained_model+" "+auth+" "+share
|
782 |
|
783 |
+
return configf
|
784 |
|
785 |
|
786 |
|