feat: lazy hash calculation for checkpoints

Checkpoints are typically large (10GB+). This change delays SHA256
hash calculation until metadata fetch from Civitai is requested,
significantly improving initial scan performance.

- Add hash_status field to BaseModelMetadata
- CheckpointScanner skips hash during initial scan
- On-demand hash calculation during Civitai fetch
- Background bulk hash calculation support
This commit is contained in:
Will Miao
2026-02-26 22:39:11 +08:00
parent 9f15c1fc06
commit 40d9f8d0aa
5 changed files with 514 additions and 4 deletions

View File

@@ -282,6 +282,11 @@ class ModelScanner:
sub_type = get_value('sub_type', None)
if sub_type:
entry['sub_type'] = sub_type
# Handle hash_status for lazy hash calculation (checkpoints)
hash_status = get_value('hash_status', 'completed')
if hash_status:
entry['hash_status'] = hash_status
return entry