Merge branch 'feature/persistent-hashing' into develop

This commit is contained in:
Manuel Schmid
2024-07-01 18:00:23 +02:00
5 changed files with 82 additions and 15 deletions
+18
View File
@@ -7,6 +7,7 @@ import args_manager
import tempfile
import modules.flags
import modules.sdxl_styles
from modules.hash_cache import load_cache_from_file, save_cache_to_file
from modules.model_loader import load_file_from_url
from modules.extra_utils import makedirs_with_log, get_files_from_folder, try_eval_env_var
@@ -889,3 +890,20 @@ def downloading_sam_vit_h():
update_files()
load_cache_from_file()
if args_manager.args.rebuild_hash_cache:
from modules.hash_cache import sha256_from_cache
from modules.util import get_file_from_folder_list
print('[Cache] Rebuilding hash cache')
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)
print('[Cache] Done')
# write cache to file again for sorting and cleanup of invalid cache entries
save_cache_to_file()