(input_args=None)
| 259 | |
| 260 | |
| 261 | def parse_args(input_args=None): |
| 262 | parser = argparse.ArgumentParser(description="Simple example of a ControlNet training script.") |
| 263 | parser.add_argument( |
| 264 | "--pretrained_model_name_or_path", |
| 265 | type=str, |
| 266 | default=None, |
| 267 | required=True, |
| 268 | help="Path to pretrained model or model identifier from huggingface.co/models.", |
| 269 | ) |
| 270 | parser.add_argument( |
| 271 | "--controlnet_model_name_or_path", |
| 272 | type=str, |
| 273 | default=None, |
| 274 | help="Path to pretrained controlnet model or model identifier from huggingface.co/models." |
| 275 | " If not specified controlnet weights are initialized from unet.", |
| 276 | ) |
| 277 | parser.add_argument( |
| 278 | "--revision", |
| 279 | type=str, |
| 280 | default=None, |
| 281 | required=False, |
| 282 | help="Revision of pretrained model identifier from huggingface.co/models.", |
| 283 | ) |
| 284 | parser.add_argument( |
| 285 | "--variant", |
| 286 | type=str, |
| 287 | default=None, |
| 288 | help="Variant of the model files of the pretrained model identifier from huggingface.co/models, 'e.g.' fp16", |
| 289 | ) |
| 290 | parser.add_argument( |
| 291 | "--output_dir", |
| 292 | type=str, |
| 293 | default="controlnet-model", |
| 294 | help="The output directory where the model predictions and checkpoints will be written.", |
| 295 | ) |
| 296 | parser.add_argument( |
| 297 | "--cache_dir", |
| 298 | type=str, |
| 299 | default=None, |
| 300 | help="The directory where the downloaded models and datasets will be stored.", |
| 301 | ) |
| 302 | parser.add_argument("--seed", type=int, default=None, help="A seed for reproducible training.") |
| 303 | parser.add_argument( |
| 304 | "--resolution", |
| 305 | type=int, |
| 306 | default=512, |
| 307 | help=( |
| 308 | "The resolution for input images, all the images in the train/validation dataset will be resized to this" |
| 309 | " resolution" |
| 310 | ), |
| 311 | ) |
| 312 | parser.add_argument( |
| 313 | "--train_batch_size", type=int, default=4, help="Batch size (per device) for the training dataloader." |
| 314 | ) |
| 315 | parser.add_argument("--num_train_epochs", type=int, default=1) |
| 316 | parser.add_argument( |
| 317 | "--max_train_steps", |
| 318 | type=int, |
no outgoing calls
no test coverage detected