-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinetune.sh
More file actions
executable file
·30 lines (27 loc) · 820 Bytes
/
Copy pathfinetune.sh
File metadata and controls
executable file
·30 lines (27 loc) · 820 Bytes
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
#!/bin/bash
# Set environment variables
export MODEL_NAME="stabilityai/stable-diffusion-2-1"
export OUTPUT_DIR="./finetune-lora-output"
export DATASET_DIR="./lora-train/image"
# Ensure the output directory exists
mkdir -p $OUTPUT_DIR
# Run the training script
accelerate launch finetune_train.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--train_data_dir=${DATASET_DIR} \
--resolution=512 \
--center_crop \
--random_flip \
--train_batch_size=1 \
--gradient_accumulation_steps=8 \
--max_train_steps=1000 \
--learning_rate=5e-05 \
--max_grad_norm=1 \
--lr_scheduler="cosine" \
--lr_warmup_steps=0 \
--output_dir=$OUTPUT_DIR \
--report_to=wandb \
--checkpointing_steps=100 \
--validation_epochs=15 \
--validation_prompt="generate a realistic interior room design" \
--seed=1337