File size: 1,523 Bytes
71ac1fa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import subprocess
subprocess.run(["accelerate", "launch", "--mixed_precision=fp16", "train_text_to_image_lora.py",
                "--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5",
                "--dataset_name=pcuenq/oxford-pets",
                "--dataloader_num_workers=8",
                "--resolution=512", "--center_crop", "--random_flip",
                "--train_batch_size=1",
                "--gradient_accumulation_steps=4",
                "--max_train_steps=5000",
                "--learning_rate=1e-04",
                "--max_grad_norm=1",
                "--lr_scheduler=cosine", "--lr_warmup_steps=0",
                "--output_dir=/home/htelvis92/182/",
                "--push_to_hub",
                "--hub_model_id=pets",
                "--checkpointing_steps=500",
                "--validation_prompt=Totoro",
                "--seed=1337",
                "--caption_column=label"])
# run script
# python train_text_to_image_lora.py \
#   --pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5 \
#   --dataset_name=pcuenq/oxford-pets \
#   --dataloader_num_workers=8 \
#   --resolution=512 --center_crop --random_flip \
#   --train_batch_size=1 \
#   --gradient_accumulation_steps=4 \
#   --max_train_steps=15000 \
#   --learning_rate=1e-04 \
#   --max_grad_norm=1 \
#   --lr_scheduler="cosine" --lr_warmup_steps=0 \
#   --output_dir=/home/htelvis92/182 \
#   --push_to_hub \
#   --hub_model_id=pets \
#   --checkpointing_steps=500 \
#   --validation_prompt="Totoro"