feat: add attribute --rebuild-hash-cache, add handling

This commit is contained in:
Manuel Schmid
2024-07-01 17:50:15 +02:00
parent 1fa7eeac84
commit b19ecf410b
2 changed files with 17 additions and 2 deletions
+13 -1
View File
@@ -757,5 +757,17 @@ def downloading_safety_checker_model():
update_files()
load_cache_from_file()
# write cache to file again for cleanup of invalid cache entries
if args_manager.args.rebuild_hash_cache:
from modules.hash_cache import sha256_from_cache
from modules.util import get_file_from_folder_list
for filename in model_filenames:
filepath = get_file_from_folder_list(filename, paths_checkpoints)
sha256_from_cache(filepath)
for filename in lora_filenames:
filepath = get_file_from_folder_list(filename, paths_loras)
sha256_from_cache(filepath)
# write cache to file again for sorting and cleanup of invalid cache entries
save_cache_to_file()