@@ -28,8 +28,10 @@ def parse_args():
2828"--model" ,
2929type = str ,
3030required = True ,
31- help = "Name of the diffusers model to train against, as defined in "
32- "'configs/models.yaml' (e.g. 'sd-1/main/stable-diffusion-v1-5')." ,
31+ help = (
32+ "Name of the diffusers model to train against, as defined in "
33+ "'configs/models.yaml' (e.g. 'sd-1/main/stable-diffusion-v1-5')."
34+ ),
3335 )
3436
3537# Training Group
@@ -38,27 +40,42 @@ def parse_args():
3840"--gradient_accumulation_steps" ,
3941type = int ,
4042default = 1 ,
41- help = "The number of gradient steps to accumulate before each weight "
42- "update. This value is passed to Hugging Face Accelerate. This is an "
43- "alternative to increasing the batch size when training with limited "
44- "VRAM." ,
43+ help = (
44+ "The number of gradient steps to accumulate before each weight"
45+ " update. This value is passed to Hugging Face Accelerate. This is"
46+ " an alternative to increasing the batch size when training with"
47+ " limited VRAM."
48+ ),
4549 )
4650training_group .add_argument (
4751"--mixed_precision" ,
4852type = str ,
4953default = None ,
50- help = "The mixed precision mode to use ('no','fp16','bf16 or 'fp8'). "
51- "This value is passed to Hugging Face Accelerate. See "
52- "accelerate.Accelerator for more details." ,
54+ help = (
55+ "The mixed precision mode to use ('no','fp16','bf16 or 'fp8'). "
56+ "This value is passed to Hugging Face Accelerate. See "
57+ "accelerate.Accelerator for more details."
58+ ),
5359 )
5460training_group .add_argument (
5561"--report_to" ,
5662type = str ,
5763default = "tensorboard" ,
58- help = "The integration to report results and logs to ('all', "
59- "'tensorboard', 'wandb', or 'comet_ml'). This value is passed to "
60- "Hugging Face Accelerate. See accelerate.Accelerator.log_with for more "
61- "details." ,
64+ help = (
65+ "The integration to report results and logs to ('all',"
66+ " 'tensorboard', 'wandb', or 'comet_ml'). This value is passed to"
67+ " Hugging Face Accelerate. See accelerate.Accelerator.log_with for"
68+ " more details."
69+ ),
70+ )
71+ training_group .add_argument (
72+ "--xformers" ,
73+ action = "store_true" ,
74+ default = False ,
75+ help = (
76+ "If set, xformers will be used for faster and more memory-efficient"
77+ " attention blocks."
78+ ),
6279 )
6380
6481return parser .parse_args ()