mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 05:32:12 -03:00
Add automatic cleanup of default values from settings.json to keep configuration files minimal and focused on user customizations. Introduces a threshold-based cleanup that only removes default values when the file contains a significant number of them (10+), preserving small template-based configurations while cleaning up legacy bloated files. Key changes: - Add DEFAULT_KEYS_CLEANUP_THRESHOLD constant to control cleanup aggressiveness - Implement _cleanup_default_values_from_disk() method that removes default values from disk while keeping them available in memory - Modify _ensure_default_settings() to only save when existing values are updated, not when defaults are inserted - Update _serialize_settings_for_disk() to only persist settings that differ from defaults - Add cleanup call during initialization for existing settings files This reduces file size and noise in settings.json while maintaining full functionality at runtime.