File size: 979 Bytes
3d0a1a1
 
93c20e4
 
 
 
cefa493
 
d0892aa
9332130
d31317e
80eead0
 
 
 
 
 
 
 
 
015d8da
80eead0
 
 
 
 
 
93c20e4
 
 
d31317e
 
 
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
#!/bin/bash

export MODEL_NAME=$1
export INSTANCE_DIR=$2
export OUTPUT_DIR=$3
export CLASS_DIR=$4
export INSTANCE_PROMPT=$5
export CLASS_PROMPT=$6

accelerate launch /repository/train_dreambooth.py \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --pretrained_vae_name_or_path="stabilityai/sd-vae-ft-mse" \
  --revision="fp16" \
  --with_prior_preservation --prior_loss_weight=1.0 \
  --seed=1337 \
  --resolution=512 \
  --train_batch_size=1 \
  --train_text_encoder \
  --mixed_precision="fp16" \
  --use_8bit_adam \
  --gradient_accumulation_steps=1 --gradient_checkpointing --learning_rate=1e-6 \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --num_class_images=50 \
  --sample_batch_size=1 \
  --max_train_steps=800 \
  --save_interval=10000 \
  --instance_prompt="$INSTANCE_PROMPT" \
  --save_sample_prompt="$INSTANCE_PROMPT" \
  --class_prompt="$CLASS_PROMPT" \
  --output_dir=$OUTPUT_DIR \
  --instance_data_dir=$INSTANCE_DIR \
  --class_data_dir=$CLASS_DIR