-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconvert_to_diffusers.sh
35 lines (32 loc) · 1.25 KB
/
convert_to_diffusers.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
#!/bin/bash
# Set the path to the directory containing the .safetensors and .ckpt files
dir_path="/nas/workspace/webui_models/models/Stable-diffusion/civitai/"
# Loop through all .safetensors files in the directory and convert them to diffusers format
for file in "$dir_path"/*.safetensors; do
filename=$(basename -- "$file")
filename="${filename%.*}"
dump_path="/nas/workspace/diffusers_models/$filename"
if [ ! -d "$dump_path" ]; then
mkdir "$dump_path"
python scripts/tools/convert_to_diffusers.py \
--checkpoint_path "$file" \
--original_config_file v1-inference.yaml \
--dump_path "$dump_path" \
--to_safetensors \
--from_safetensors
fi
done
# Loop through all .ckpt files in the directory and convert them to diffusers format
for file in "$dir_path"/*.ckpt; do
filename=$(basename -- "$file")
filename="${filename%.*}"
dump_path="/nas/workspace/diffusers_models/$filename"
if [ ! -d "$dump_path" ]; then
mkdir "$dump_path"
python scripts/tools/convert_to_diffusers.py \
--checkpoint_path "$file" \
--original_config_file v1-inference.yaml \
--dump_path "$dump_path" \
--to_safetensors
fi
done