-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheck_model.py
53 lines (45 loc) · 2.61 KB
/
check_model.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
48
49
50
51
52
import os
def check_model_structure():
structure = ''
model_dir = './extensions/IC-Light-SD-WebUI/models'
if not os.path.exists(model_dir+'/iclight_sd15_fbc.safetensors'):
structure += 'iclight_sd15_fbc.safetensors not found\n'
if not os.path.exists(model_dir+'/iclight_sd15_fbc.safetensors'):
structure += 'iclight_sd15_fbc.safetensors not found\n'
if not os.path.exists(model_dir+'/rmbg/config.json'):
structure += 'rmbg/config.json not found\n'
if not os.path.exists(model_dir+'/rmbg/model.pth'):
structure += 'rmbg/model.pth not found\n'
if not os.path.exists(model_dir+'/rmbg/model.safetensors'):
structure += 'rmbg/model.safetensors not found\n'
if not os.path.exists(model_dir+'/rmbg/pytorch_model.bin'):
structure += 'rmbg/pytorch_model.bin not found\n'
if not os.path.exists(model_dir+'/text_encoder/config.json'):
structure += 'text_encoder/config.json not found\n'
if not os.path.exists(model_dir+'/text_encoder/model.safetensors'):
structure += 'text_encoder/model.safetensors not found\n'
if not os.path.exists(model_dir+'/text_encoder/pytorch_model.bin'):
structure += 'text_encoder/pytorch_model.bin not found\n'
if not os.path.exists(model_dir+'/tokenizer/special_tokens_map.json'):
structure += 'tokenizer/special_tokens_map.json not found\n'
if not os.path.exists(model_dir+'/tokenizer/tokenizer_config.json'):
structure += 'tokenizer/tokenizer_config.json not found\n'
if not os.path.exists(model_dir+'/tokenizer/vocab.json'):
structure += 'tokenizer/vocab.json not found\n'
if not os.path.exists(model_dir+'/tokenizer/merges.txt'):
structure += 'tokenizer/merges.txt not found\n'
if not os.path.exists(model_dir+'/unet/config.json'):
structure += 'unet/config.json not found\n'
if not os.path.exists(model_dir+'/unet/diffusion_pytorch_model.bin'):
structure += 'unet/diffusion_pytorch_model.bin not found\n'
if not os.path.exists(model_dir+'/unet/diffusion_pytorch_model.safetensors'):
structure += 'unet/diffusion_pytorch_model.safetensors not found\n'
if not os.path.exists(model_dir+'/vae/config.json'):
structure += 'vae/config.json not found\n'
if not os.path.exists(model_dir+'/vae/diffusion_pytorch_model.bin'):
structure += 'vae/diffusion_pytorch_model.bin not found\n'
if not os.path.exists(model_dir+'/vae/diffusion_pytorch_model.safetensors'):
structure += 'vae/diffusion_pytorch_model.safetensors not found\n'
if structure == '':
structure = 'All files found'
return structure