| 44 | |
| 45 | |
| 46 | def parse_args(): |
| 47 | parser = argparse.ArgumentParser(description="Simple example of a training script.") |
| 48 | parser.add_argument( |
| 49 | "--pretrained_model_name_or_path", |
| 50 | type=str, |
| 51 | default=None, |
| 52 | required=True, |
| 53 | help="Path to pretrained model or model identifier from huggingface.co/models.", |
| 54 | ) |
| 55 | parser.add_argument( |
| 56 | "--pretrained_vae_name_or_path", |
| 57 | type=str, |
| 58 | default=None, |
| 59 | help="Path to pretrained vae or vae identifier from huggingface.co/models.", |
| 60 | ) |
| 61 | parser.add_argument( |
| 62 | "--revision", |
| 63 | type=str, |
| 64 | default=None, |
| 65 | required=False, |
| 66 | help="Revision of pretrained model identifier from huggingface.co/models.", |
| 67 | ) |
| 68 | parser.add_argument( |
| 69 | "--tokenizer_name", |
| 70 | type=str, |
| 71 | default=None, |
| 72 | help="Pretrained tokenizer name or path if not the same as model_name", |
| 73 | ) |
| 74 | parser.add_argument( |
| 75 | "--instance_data_dir", |
| 76 | type=str, |
| 77 | default=None, |
| 78 | required=True, |
| 79 | help="A folder containing the training data of instance images.", |
| 80 | ) |
| 81 | parser.add_argument( |
| 82 | "--class_data_dir", |
| 83 | type=str, |
| 84 | default=None, |
| 85 | required=False, |
| 86 | help="A folder containing the training data of class images.", |
| 87 | ) |
| 88 | parser.add_argument( |
| 89 | "--instance_prompt", |
| 90 | type=str, |
| 91 | default=None, |
| 92 | help="The prompt with identifier specifying the instance", |
| 93 | ) |
| 94 | parser.add_argument( |
| 95 | "--class_prompt", |
| 96 | type=str, |
| 97 | default=None, |
| 98 | help="The prompt to specify images in the same class as provided instance images.", |
| 99 | ) |
| 100 | parser.add_argument( |
| 101 | "--with_prior_preservation", |
| 102 | default=False, |
| 103 | action="store_true", |