forked from Reality-Editor/Composition-Stable-Diffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
29 lines (26 loc) · 940 Bytes
/
run.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
export MODEL_NAME="runwayml/stable-diffusion-inpainting"
export INSTANCE_DIR="data/sofa"
export TEST_DIR="data/sofa_test"
export OUT_DIR="out/sofa"
export INSTANCE_PROMPT="sofa"
export MODEL_DIR="logs/sofa"
# preprocess data
python preprocess.py --instance_data_dir $INSTANCE_DIR \
--instance_prompt $INSTANCE_PROMPT
# CUDA_VISIBLE_DEVICES=0
accelerate launch --num_processes 1 train.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--instance_data_dir=$INSTANCE_DIR \
--output_dir=$MODEL_DIR \
--instance_prompt=$INSTANCE_PROMPT \
--resolution=512 \
--train_batch_size=1 \
--gradient_accumulation_steps=1 \
--learning_rate=5e-6 \
--lr_scheduler="constant" \
--lr_warmup_steps=0 \
--max_train_steps=1000
python inference.py --image_path $TEST_DIR \
--model_path $MODEL_DIR \
--out_path $OUT_DIR \
--instance_prompt $INSTANCE_PROMPT