TheLastBen
commited on
Commit
•
b4d3981
1
Parent(s):
2eb89c1
Update Scripts/mainpaperspacev1.py
Browse files- Scripts/mainpaperspacev1.py +13 -2
Scripts/mainpaperspacev1.py
CHANGED
@@ -181,7 +181,6 @@ def dl(Path_to_HuggingFace, CKPT_Path, CKPT_Link):
|
|
181 |
MODEL_NAME="/datasets/stable-diffusion-diffusers/stable-diffusion-v1-5"
|
182 |
print('[1;32mUsing the original V1.5 model')
|
183 |
|
184 |
-
call("sed -i 's@\"sample_size\": 256,@\"sample_size\": 512,@g' "+MODEL_NAME+"/vae/config.json", shell=True)
|
185 |
return MODEL_NAME
|
186 |
|
187 |
|
@@ -304,6 +303,11 @@ def done():
|
|
304 |
|
305 |
def uplder(Remove_existing_instance_images, Crop_images, Crop_size, IMAGES_FOLDER_OPTIONAL, INSTANCE_DIR, CAPTIONS_DIR, ren):
|
306 |
|
|
|
|
|
|
|
|
|
|
|
307 |
uploader = widgets.FileUpload(description="Choose images",accept='image/*', multiple=True)
|
308 |
Upload = widgets.Button(
|
309 |
description='Upload',
|
@@ -500,6 +504,13 @@ def caption(CAPTIONS_DIR, INSTANCE_DIR):
|
|
500 |
|
501 |
def dbtrain(Resume_Training, UNet_Training_Steps, UNet_Learning_Rate, Text_Encoder_Training_Steps, Text_Encoder_Concept_Training_Steps, Text_Encoder_Learning_Rate, Style_Training, Resolution, MODEL_NAME, SESSION_DIR, INSTANCE_DIR, CONCEPT_DIR, CAPTIONS_DIR, External_Captions, INSTANCE_NAME, Session_Name, OUTPUT_DIR, PT, resume, Save_Checkpoint_Every_n_Steps, Start_saving_from_the_step, Save_Checkpoint_Every):
|
502 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
if resume and not Resume_Training:
|
504 |
print('[1;31mOverwrite your previously trained model ?, answering "yes" will train a new model, answering "no" will resume the training of the previous model? yes or no ?[0m')
|
505 |
while True:
|
@@ -555,7 +566,7 @@ def dbtrain(Resume_Training, UNet_Training_Steps, UNet_Learning_Rate, Text_Encod
|
|
555 |
Enable_Text_Encoder_Concept_Training= True
|
556 |
|
557 |
|
558 |
-
if Text_Encoder_Training_Steps==0
|
559 |
Enable_text_encoder_training= False
|
560 |
else:
|
561 |
stptxt=Text_Encoder_Training_Steps
|
|
|
181 |
MODEL_NAME="/datasets/stable-diffusion-diffusers/stable-diffusion-v1-5"
|
182 |
print('[1;32mUsing the original V1.5 model')
|
183 |
|
|
|
184 |
return MODEL_NAME
|
185 |
|
186 |
|
|
|
303 |
|
304 |
def uplder(Remove_existing_instance_images, Crop_images, Crop_size, IMAGES_FOLDER_OPTIONAL, INSTANCE_DIR, CAPTIONS_DIR, ren):
|
305 |
|
306 |
+
if os.path.exists(INSTANCE_DIR+"/.ipynb_checkpoints"):
|
307 |
+
call('rm -r '+INSTANCE_DIR+'/.ipynb_checkpoints', shell=True)
|
308 |
+
if os.path.exists(CONCEPT_DIR+"/.ipynb_checkpoints"):
|
309 |
+
call('rm -r '+CONCEPT_DIR+'/.ipynb_checkpoints', shell=True)
|
310 |
+
|
311 |
uploader = widgets.FileUpload(description="Choose images",accept='image/*', multiple=True)
|
312 |
Upload = widgets.Button(
|
313 |
description='Upload',
|
|
|
504 |
|
505 |
def dbtrain(Resume_Training, UNet_Training_Steps, UNet_Learning_Rate, Text_Encoder_Training_Steps, Text_Encoder_Concept_Training_Steps, Text_Encoder_Learning_Rate, Style_Training, Resolution, MODEL_NAME, SESSION_DIR, INSTANCE_DIR, CONCEPT_DIR, CAPTIONS_DIR, External_Captions, INSTANCE_NAME, Session_Name, OUTPUT_DIR, PT, resume, Save_Checkpoint_Every_n_Steps, Start_saving_from_the_step, Save_Checkpoint_Every):
|
506 |
|
507 |
+
if os.path.exists(INSTANCE_DIR+"/.ipynb_checkpoints"):
|
508 |
+
call('rm -r '+INSTANCE_DIR+'/.ipynb_checkpoints', shell=True)
|
509 |
+
if os.path.exists(CONCEPT_DIR+"/.ipynb_checkpoints"):
|
510 |
+
call('rm -r '+CONCEPT_DIR+'/.ipynb_checkpoints', shell=True)
|
511 |
+
if os.path.exists(CAPTIONS_DIR+"/.ipynb_checkpoints"):
|
512 |
+
call('rm -r '+CAPTIONS_DIR+'/.ipynb_checkpoints', shell=True)
|
513 |
+
|
514 |
if resume and not Resume_Training:
|
515 |
print('[1;31mOverwrite your previously trained model ?, answering "yes" will train a new model, answering "no" will resume the training of the previous model? yes or no ?[0m')
|
516 |
while True:
|
|
|
566 |
Enable_Text_Encoder_Concept_Training= True
|
567 |
|
568 |
|
569 |
+
if Text_Encoder_Training_Steps==0:
|
570 |
Enable_text_encoder_training= False
|
571 |
else:
|
572 |
stptxt=Text_Encoder_Training_Steps
|