dkebudi commited on
Commit
8a0d5c0
·
verified ·
1 Parent(s): bd3d196

revert to original

Browse files
train_dreambooth_lora_sdxl_advanced.py CHANGED
@@ -828,17 +828,17 @@ def parse_args(input_args=None):
828
  if env_local_rank != -1 and env_local_rank != args.local_rank:
829
  args.local_rank = env_local_rank
830
 
831
- # if args.with_prior_preservation:
832
- # if args.class_data_dir is None:
833
- # raise ValueError("You must specify a data directory for class images.")
834
- # if args.class_prompt is None:
835
- # raise ValueError("You must specify prompt for class images.")
836
- # else:
837
- # # logger is not available yet
838
- # if args.class_data_dir is not None:
839
- # warnings.warn("You need not use --class_data_dir without --with_prior_preservation.")
840
- # if args.class_prompt is not None:
841
- # warnings.warn("You need not use --class_prompt without --with_prior_preservation.")
842
 
843
  return args
844
 
@@ -1322,9 +1322,6 @@ def main(args):
1322
 
1323
  # Generate class images if prior preservation is enabled.
1324
  if args.with_prior_preservation:
1325
- if args.class_data_dir is None:
1326
- class_folder = str(uuid.uuid4())
1327
- args.class_data_dir = os.path.join("ariadne", class_folder)
1328
  class_images_dir = Path(args.class_data_dir)
1329
  if not class_images_dir.exists():
1330
  class_images_dir.mkdir(parents=True)
 
828
  if env_local_rank != -1 and env_local_rank != args.local_rank:
829
  args.local_rank = env_local_rank
830
 
831
+ if args.with_prior_preservation:
832
+ if args.class_data_dir is None:
833
+ raise ValueError("You must specify a data directory for class images.")
834
+ if args.class_prompt is None:
835
+ raise ValueError("You must specify prompt for class images.")
836
+ else:
837
+ # logger is not available yet
838
+ if args.class_data_dir is not None:
839
+ warnings.warn("You need not use --class_data_dir without --with_prior_preservation.")
840
+ if args.class_prompt is not None:
841
+ warnings.warn("You need not use --class_prompt without --with_prior_preservation.")
842
 
843
  return args
844
 
 
1322
 
1323
  # Generate class images if prior preservation is enabled.
1324
  if args.with_prior_preservation:
 
 
 
1325
  class_images_dir = Path(args.class_data_dir)
1326
  if not class_images_dir.exists():
1327
  class_images_dir.mkdir(parents=True)