-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinference.sh
More file actions
61 lines (55 loc) · 1.57 KB
/
inference.sh
File metadata and controls
61 lines (55 loc) · 1.57 KB
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
55
56
57
58
59
60
61
#!/usr/bin/env bash
set -euo pipefail
export CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-0}
MODEL=${MODEL:-ldm}
PROMPT=${PROMPT:-"A serene lakeside at sunset, ultra-detailed digital art"}
OUTPUT_DIR=${OUTPUT_DIR:-"ldm"}
DEVICE=${DEVICE:-cuda:0}
NUM_IMAGES=${NUM_IMAGES:-1}
BATCH_SIZE=${BATCH_SIZE:-1}
INFERENCE_STEPS=(20)
s=(0.5)
CFG_SCALES=(7.5)
m=(15)
SP_INTERVAL=1
FI_INTERVAL=1
WARM_UP=0
CACHE_INTERVAL=2
CACHE_BRANCH_ID=0
USE_DEEPCACHE=${USE_DEEPCACHE:-1}
USE_PROGRESSIVE=${USE_PROGRESSIVE:-1}
mkdir -p "${OUTPUT_DIR}"
for inference_step in "${INFERENCE_STEPS[@]}"; do
for strength in "${s[@]}"; do
for cfg in "${CFG_SCALES[@]}"; do
for gate_step in "${m[@]}"; do
echo "Running ${MODEL} | steps=${inference_step} s=${strength} cfg=${cfg} m=${gate_step}"
cmd=(
python main.py
--saved_path "${OUTPUT_DIR}"
--model "${MODEL}"
--prompt "${PROMPT}"
--num_img "${NUM_IMAGES}"
--batch_size "${BATCH_SIZE}"
--inference_step "${inference_step}"
--strength "${strength}"
--cfg "${cfg}"
--gate_step "${gate_step}"
--sp_interval "${SP_INTERVAL}"
--fi_interval "${FI_INTERVAL}"
--warm_up "${WARM_UP}"
--cache_interval "${CACHE_INTERVAL}"
--cache_branch_id "${CACHE_BRANCH_ID}"
--device "${DEVICE}"
)
if (( USE_DEEPCACHE )); then
cmd+=(--deepcache)
fi
if (( USE_PROGRESSIVE )); then
cmd+=(--use_progressive)
fi
"${cmd[@]}"
done
done
done
done