TheLastBen
commited on
Commit
•
2eb89c1
1
Parent(s):
6f159ac
Update Scripts/mainpaperspacev2.py
Browse files
Scripts/mainpaperspacev2.py
CHANGED
@@ -120,6 +120,8 @@ def downloadmodel_pthv2(CKPT_Path, Custom_Model_Version):
|
|
120 |
call('python convertodiffv2.py '+CKPT_Path+' stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1-base', shell=True)
|
121 |
elif Custom_Model_Version=='768':
|
122 |
call('python convertodiffv2.py '+CKPT_Path+' stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1', shell=True)
|
|
|
|
|
123 |
call('rm convertodiffv2.py', shell=True)
|
124 |
if os.path.exists('stable-diffusion-custom/unet/diffusion_pytorch_model.bin'):
|
125 |
os.chdir('/notebooks')
|
@@ -150,6 +152,8 @@ def downloadmodel_lnkv2(CKPT_Link, Custom_Model_Version):
|
|
150 |
call('python convertodiffv2.py model.ckpt stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1-base', shell=True)
|
151 |
elif Custom_Model_Version=='768':
|
152 |
call('python convertodiffv2.py model.ckpt stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1', shell=True)
|
|
|
|
|
153 |
call('rm convertodiffv2.py', shell=True)
|
154 |
if os.path.exists('stable-diffusion-custom/unet/diffusion_pytorch_model.bin'):
|
155 |
call('rm model.ckpt', shell=True)
|
@@ -272,18 +276,15 @@ def sessv2(Session_Name, Session_Link_optional, Model_Version, MODEL_NAMEv2):
|
|
272 |
|
273 |
elif os.path.exists(MDLPTH):
|
274 |
print('[1;32mSession found, loading the trained model ...')
|
|
|
275 |
if Model_Version=='512':
|
276 |
-
call("wget -q -O convertodiff.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dreambooth/convertodiffv2.py", shell=True)
|
277 |
-
clear_output()
|
278 |
print('[1;32mSession found, loading the trained model ...')
|
279 |
call('python convertodiff.py '+MDLPTH+' '+OUTPUT_DIR+' --v2 --reference_model stabilityai/stable-diffusion-2-1-base', shell=True)
|
280 |
-
|
281 |
elif Model_Version=='768':
|
282 |
-
call('wget -q -O convertodiff.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dreambooth/convertodiffv2.py', shell=True)
|
283 |
-
clear_output()
|
284 |
print('[1;32mSession found, loading the trained model ...')
|
285 |
call('python convertodiff.py '+MDLPTH+' '+OUTPUT_DIR+' --v2 --reference_model stabilityai/stable-diffusion-2-1', shell=True)
|
286 |
-
|
|
|
287 |
call('rm convertodiff.py', shell=True)
|
288 |
|
289 |
if os.path.exists(OUTPUT_DIR+'/unet/diffusion_pytorch_model.bin'):
|
|
|
120 |
call('python convertodiffv2.py '+CKPT_Path+' stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1-base', shell=True)
|
121 |
elif Custom_Model_Version=='768':
|
122 |
call('python convertodiffv2.py '+CKPT_Path+' stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1', shell=True)
|
123 |
+
if os.path.exists('stable-diffusion-custom/unet/diffusion_pytorch_model.bin'):
|
124 |
+
call('wget -q -O stable-diffusion-custom/unet/config.json https://huggingface.co/stabilityai/stable-diffusion-2-1/raw/main/unet/config.json', shell=True)
|
125 |
call('rm convertodiffv2.py', shell=True)
|
126 |
if os.path.exists('stable-diffusion-custom/unet/diffusion_pytorch_model.bin'):
|
127 |
os.chdir('/notebooks')
|
|
|
152 |
call('python convertodiffv2.py model.ckpt stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1-base', shell=True)
|
153 |
elif Custom_Model_Version=='768':
|
154 |
call('python convertodiffv2.py model.ckpt stable-diffusion-custom --v2 --reference_model stabilityai/stable-diffusion-2-1', shell=True)
|
155 |
+
if os.path.exists('stable-diffusion-custom/unet/diffusion_pytorch_model.bin'):
|
156 |
+
call('wget -q -O stable-diffusion-custom/unet/config.json https://huggingface.co/stabilityai/stable-diffusion-2-1/raw/main/unet/config.json', shell=True)
|
157 |
call('rm convertodiffv2.py', shell=True)
|
158 |
if os.path.exists('stable-diffusion-custom/unet/diffusion_pytorch_model.bin'):
|
159 |
call('rm model.ckpt', shell=True)
|
|
|
276 |
|
277 |
elif os.path.exists(MDLPTH):
|
278 |
print('[1;32mSession found, loading the trained model ...')
|
279 |
+
call('wget -q -O convertodiff.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dreambooth/convertodiffv2.py', shell=True)
|
280 |
if Model_Version=='512':
|
|
|
|
|
281 |
print('[1;32mSession found, loading the trained model ...')
|
282 |
call('python convertodiff.py '+MDLPTH+' '+OUTPUT_DIR+' --v2 --reference_model stabilityai/stable-diffusion-2-1-base', shell=True)
|
|
|
283 |
elif Model_Version=='768':
|
|
|
|
|
284 |
print('[1;32mSession found, loading the trained model ...')
|
285 |
call('python convertodiff.py '+MDLPTH+' '+OUTPUT_DIR+' --v2 --reference_model stabilityai/stable-diffusion-2-1', shell=True)
|
286 |
+
if os.path.exists(OUTPUT_DIR+'/unet/diffusion_pytorch_model.bin'):
|
287 |
+
call('wget -q -O '+OUTPUT_DIR+'/unet/config.json https://huggingface.co/stabilityai/stable-diffusion-2-1/raw/main/unet/config.json', shell=True)
|
288 |
call('rm convertodiff.py', shell=True)
|
289 |
|
290 |
if os.path.exists(OUTPUT_DIR+'/unet/diffusion_pytorch_model.bin'):
|