-
Notifications
You must be signed in to change notification settings - Fork 1
/
train.sh
54 lines (39 loc) · 1.62 KB
/
train.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## If it's unaccessable for your machine to reach Internet,
## uncomment the following environment variable,
## these allows you to read model files directly from the local cache.
# export HF_HUB_OFFLINE=1
# export TRANSFORMERS_OFFLINE=1
# export DIFFUSERS_OFFLINE=1
# export HF_HOME=/Path/To/Your/huggingFace
# export HUGGINFACE_HUB_CACHE=/Path/To/Your/huggingFace
# export TORCH_HOME=/Path/To/Your/torch
## For single GPU debugging
# python3 train_sdxl.py --config config/train/style_crafter_sdxl_512.yaml
## For real training
## Stage 1
OUTPUT_DIR="/Path/To/Your/Output/Directory"
NAME="stylecrafter_sdxl_512"
mkdir -p $OUTPUT_DIR/$NAME
accelerate launch --num_processes 8 --multi_gpu --mixed_precision "bf16" \
train_sdxl.py \
--config config/train/style_crafter_sdxl_512.yaml \
--output_dir=$OUTPUT_DIR/$NAME \
# --pretrained "/Path/To/Your/Output/Directory/pretrained.ckpt"
## Stage 2
OUTPUT_DIR="/Path/To/Your/Output/Directory"
NAME="stylecrafter_sdxl_1024"
mkdir -p $OUTPUT_DIR/$NAME
accelerate launch --num_processes 8 --multi_gpu --mixed_precision "bf16" \
train_sdxl.py \
--config config/train/style_crafter_sdxl_1024.yaml \
--output_dir=$OUTPUT_DIR/$NAME \
--pretrained "/Path/To/Your/Output/Directory/pretrained_stage1.ckpt"
## Stage 3
OUTPUT_DIR="/Path/To/Your/Output/Directory"
NAME="stylecrafter_sdxl_1024_noise_offset"
mkdir -p $OUTPUT_DIR/$NAME
accelerate launch --num_processes 8 --multi_gpu --mixed_precision "bf16" \
train_sdxl.py \
--config config/train/style_crafter_sdxl_1024_noise_offset.yaml \
--output_dir=$OUTPUT_DIR/$NAME \
--pretrained "/Path/To/Your/Output/Directory/pretrained_stage2.ckpt"