_load_stats() was missing the embeddings section, so on every restart
the embeddings usage tracking hash would start from an empty dict.
This caused all previously saved embedding usage data to appear reset.
Added the missing load path for the 'embeddings' key, parallel to the
existing checkpoints and loras loading logic.
- Change _get_stats_file_path() to use get_settings_dir()/stats/ instead of
first loras root directory
- Add _migrate_from_old_location() to copy existing stats from loras root
to new location on first access, then clean up old file
- Add 'stats' to update protection skip lists (clean, extract, tracking)
to prevent data loss during ZIP/git upgrades in portable mode
- Add usage_stats entry to backup targets and restore resolver so stats
are included in automatic snapshots
Fixes#394 — LoRAs loaded via rgthree Power Lora Loader were not
tracked in usage statistics because no extractor existed for that node.
New extractors:
- RgthreePowerLoraLoaderExtractor: parses LORA_* kwargs, respects
the per-LoRA 'on' toggle
- TensorRTLoaderExtractor: parses engine filename (strips _$profile
suffix) as best-effort for vanilla TRT. If the output MODEL has
attachments["source_model"] (set by NubeBuster fork), overrides
with the real checkpoint name.
TensorRTRefitLoader and TensorRTLoaderAuto take a MODEL input whose
upstream checkpoint loader is already tracked — no extractor needed.
Also adds a name:<filename> fallback and warning log in both
_process_checkpoints and _process_loras when hash lookup fails.
- Add is_dirty flag to track if statistics have changed
- Only write stats file when data actually changes
- Add enable_usage_statistics setting in ComfyUI settings
- Skip backend requests when usage statistics is disabled
- Fix standalone mode compatibility for MetadataRegistry
Fixes#826
fix(example_images_download_manager): re-raise specific exception on download error
refactor(usage_stats): define constants locally to avoid conditional imports
test(example_images_download_manager): update exception handling in download tests
test(example_images_file_manager): differentiate between os.startfile and subprocess.Popen in tests
test(example_images_paths): ensure valid example images root with single-library mode
test(usage_stats): use string literals for metadata payload to avoid conditional imports