| 177 | |
| 178 | |
| 179 | def parse_args(): |
| 180 | parser = argparse.ArgumentParser(description="Simple example of a training script.") |
| 181 | parser.add_argument( |
| 182 | "--pretrained_model_name_or_path", |
| 183 | type=str, |
| 184 | required=True, |
| 185 | help="Path to pretrained model or model identifier from huggingface.co/models.", |
| 186 | ) |
| 187 | parser.add_argument( |
| 188 | "--controlnet_model_name_or_path", |
| 189 | type=str, |
| 190 | default=None, |
| 191 | help="Path to pretrained controlnet model or model identifier from huggingface.co/models." |
| 192 | " If not specified controlnet weights are initialized from unet.", |
| 193 | ) |
| 194 | parser.add_argument( |
| 195 | "--revision", |
| 196 | type=str, |
| 197 | default=None, |
| 198 | help="Revision of pretrained model identifier from huggingface.co/models.", |
| 199 | ) |
| 200 | parser.add_argument( |
| 201 | "--from_pt", |
| 202 | action="store_true", |
| 203 | help="Load the pretrained model from a PyTorch checkpoint.", |
| 204 | ) |
| 205 | parser.add_argument( |
| 206 | "--controlnet_revision", |
| 207 | type=str, |
| 208 | default=None, |
| 209 | help="Revision of controlnet model identifier from huggingface.co/models.", |
| 210 | ) |
| 211 | parser.add_argument( |
| 212 | "--profile_steps", |
| 213 | type=int, |
| 214 | default=0, |
| 215 | help="How many training steps to profile in the beginning.", |
| 216 | ) |
| 217 | parser.add_argument( |
| 218 | "--profile_validation", |
| 219 | action="store_true", |
| 220 | help="Whether to profile the (last) validation.", |
| 221 | ) |
| 222 | parser.add_argument( |
| 223 | "--profile_memory", |
| 224 | action="store_true", |
| 225 | help="Whether to dump an initial (before training loop) and a final (at program end) memory profile.", |
| 226 | ) |
| 227 | parser.add_argument( |
| 228 | "--ccache", |
| 229 | type=str, |
| 230 | default=None, |
| 231 | help="Enables compilation cache.", |
| 232 | ) |
| 233 | parser.add_argument( |
| 234 | "--controlnet_from_pt", |
| 235 | action="store_true", |
| 236 | help="Load the controlnet model from a PyTorch checkpoint.", |