forked from ZillaRU/SD-lcm-tpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_model_path.py
47 lines (40 loc) · 1.15 KB
/
build_model_path.py
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
'''example
"awportrait": {
"name": "awportrait",
"encoder": "te_f32.bmodel",
"unet": "unet_2_1684x_F16.bmodel",
"vae_decoder": "vae_decoder_multize.bmodel",
"vae_encoder": "vae_encoder_multize.bmodel",
"controlnet": "canny_multize",
"latent_shape": {
"512x512": True,
"768x512": True,
"512x768": False
}
},
'''
import json
import os
models_path = "models/basic"
folders_name = os.listdir(models_path)
def build_json():
data = {}
for i in folders_name:
# data[i]
data[i] = {
"name": i,
"encoder": "sdv15_text.bmodel",
"unet": "sdv15_unet_multisize.bmodel",
"vae_decoder": "sdv15_vd_multisize.bmodel",
"vae_encoder": "sdv15_ve_multisize.bmodel",
"controlnet": "canny_multize",
"latent_shape": {
"512x512": "True",
"768x512": "True",
"512x768": "False"
}
}
# print(data)
dict_str = json.dumps(data, ensure_ascii=False, indent=4)
print("model_path = " + dict_str)
build_json()