Commit Graph
34 Commits
Author SHA1 Message Date
Dariusz L 27ce316c67 perf: optimize hash cache building with in-memory dir entries and thread pool 2026-09-08 18:43:51 +02:00
Dariusz L ddc5333bd2 refactor: unify model data contracts 2026-08-21 23:10:26 +02:00
Dariusz L 6309be8efe refactor(core): centralize alphanumeric normalization 2026-08-06 17:12:26 +02:00
Dariusz L a244369c97 refactor shared path comparison keys 2026-08-05 17:46:06 +02:00
Dariusz L 5b8969430b refactor: unify sidecar candidate ordering 2026-08-05 05:11:33 +02:00
Dariusz L 75cc40cfb0 refactor: unify model path identity 2026-08-05 05:02:49 +02:00
Dariusz L da6a3713ad refactor: share safe sidecar path validation 2026-08-05 02:51:19 +02:00
Dariusz L e1e725792b Unify shared path normalization 2026-08-03 12:59:04 +02:00
Dariusz L 57b79ba208 refactor: remove dead compatibility shims 2026-08-02 04:03:09 +02:00
Dariusz L 31ad1cde7c refactor: introduce Model Resolver-owned metadata sidecars and build modes 2026-07-27 15:00:18 +02:00
Dariusz L 16a69f6c47 refactor: unify provider JSON requests, catalog sync, and normalization across backend; add frontend HTML escaping helpers 2026-07-20 15:13:57 +02:00
Dariusz L 8cc02010b0 Remove unused backend and frontend code 2026-07-18 14:47:05 +02:00
Dariusz L 0b53fca8c6 refactor: unify category resolution, network requests, sidecar lookup, and progress tracking
Consolidate provider-specific category mapping into resolve_model_category(),
shared JSON request handling into execute_provider_json_request(), sidecar
path resolution into get_or_build_model_sidecar_info(), and progress
reporting into ProgressTracker. Update civitai/civarchive/common sources to
use the unified helpers. Add tests for the new utilities. Remove redundant
frontend wrapper methods from render_format_methods.js.
2026-07-18 12:48:11 +02:00
Dariusz L aff97c5e29 refactor: centralize shared normalization, timestamp, and search-result helpers 2026-07-18 10:02:34 +02:00
Dariusz L 719b3b3f43 Refactor: centralize metadata sidecar helpers and custom-result builders 2026-07-18 09:43:27 +02:00
Dariusz L be12494953 refactor: centralize shared utilities across backend and frontend
Backend:
- Move SHA256 normalization logic from path_utils._normalize_header_sha256
  into core/type_utils.normalize_sha256, adding support for 0x-prefixed
  hashes and unifying the normalization path used by
  extract_safetensors_header_sha256.
- Add tests for the 0x prefix normalization cases.

Frontend:
- Introduce copyTextWithFeedback in web/resolver/utils/html_utils.js
  as a shared clipboard helper with configurable feedback text, CSS class,
  and duration, replacing repeated inline clipboard copy logic in
  globals.js, model_info_methods.js, and the notification utility.
- Centralize showNotification on ResolverManagerDialog and remove the
  duplicate implementation from missingBrowserMethods.
- Replace local const localStorage = safeStorage aliases in
  model_info_methods.js, missing_browser_methods.js, and
  options_methods.js with direct safeStorage usage.
2026-07-17 18:06:22 +02:00
Dariusz L 20a83c7262 refactor: improve code quality and consistency across backend modules 2026-07-16 11:00:45 +02:00
Dariusz L 38dc3e4474 refactor: centralize shared utilities, normalize imports, and configure project linting 2026-07-16 10:52:06 +02:00
Dariusz L 8cf688eba6 refactor: centralize source API requests, polling, and path parsing
- Add request_source_response and request_source_json helpers with 429 retry logic
- Introduce shared split_path_segments and parse_provider_model_url utilities
- Migrate CivitAI, CivArchive, HuggingFace, and ModelList sources to centralized helpers
- Add generic pollBackgroundTask utility for frontend progress polling
- Add tests for request_source_json, split_path_segments, parse_provider_model_url
- Add huggingface-hub to requirements
2026-07-14 12:03:35 +02:00
Dariusz L 629bc791a6 feat: extract richer local metadata from safetensors headers, improve base-model inference, and preserve local data when remote lookups fail 2026-07-05 04:22:25 +02:00
Dariusz L a079733130 Extract SHA256 from safetensors header and track hash source 2026-07-05 03:00:07 +02:00
Dariusz L 3f54bd4979 Restrict file access to configured model roots and sanitize download filenames 2026-07-04 23:56:50 +02:00
Dariusz L 683eb6dfef Translate Polish workflow output and docstrings to English 2026-07-04 20:42:46 +02:00
Dariusz L cb666902e5 refactor: centralize hash calculation callbacks and catalog backup logic 2026-07-04 00:18:41 +02:00
Dariusz L cbf91eb960 fix: filter local hash match candidates and avoid sidecar self-match 2026-07-03 20:20:36 +02:00
Dariusz L 8ce70c30e6 refactor: consolidate shared utilities into type_utils and path_utils
Replace duplicated SHA256 normalization, metadata sidecar discovery, trained-words
extraction, type coercion, and cache helpers into shared modules. Clarify that the
_civitai.py/_civarchive.py/_huggingface.py/_workflow_analyzer.py refactorings are
behavior-preserving so future contributors keep behavior aligned in one place.
2026-07-02 22:41:56 +02:00
Dariusz L 37383ac046 refactor: consolidate logger imports and replace deprecated log.warn usage 2026-07-02 17:27:54 +02:00
Dariusz L c6441aa92e feat: add FATAL log level, refactor logging colors and stacklevel
- Add FATAL (50) to LogLevel enum, LEVEL_MAP, and LEVEL_THEME (bright red #E74C3C)
- Drop legacy COLORS dict in favor of LEVEL_THEME RGB values + ANSI_RESET
- Replace hard-coded stacklevel=4 with _INTERNAL_FRAMES constant so caller
  location is always correct regardless of call-chain depth
- Simplify _normalize_module_name by removing redundant path normalization
- Add fatal() to ModuleLogger, AzLogsLogger, and module-level API
- Lazily init _log in path_utils via _get_log() to avoid circular imports
2026-06-30 22:07:15 +02:00
Dariusz L a7f5f70e3c refactor: migrate logging from global functions to per-module loggers
Replace global log_* wrapper functions with create_module_logger(__name__)
instances across the codebase, enabling proper module-level logger
namespacing. Simplifies core/log_system/log_funcs.py by removing legacy
_normalize_module_path and cleaning up _normalize_module_name. Bumps
log_system config to 2.0.0 and introduces PROJECT_ALIASES for cleaner
log module prefix stripping.
2026-06-30 21:24:33 +02:00
Dariusz L a320d4d805 refactor: consolidate duplicated logic into shared utilities
- Add get_comfy_root_path() to core/path_utils.py and use it in __init__.py and core/downloader.py instead of inline logic
- Add select_primary_model_file(), parse_size_to_bytes(), get_version_sort_key(), and check_credential_http() to core/type_utils.py
- Replace duplicated credential-check helpers in civitai.py, huggingface.py with check_credential_http()
- Replace duplicated size parsing and version sorting in civarchive.py, civitai.py with shared utilities
- Replace duplicated primary-file selection in civarchive.py, civitai.py, lora_manager_archive.py with select_primary_model_file()
- Replace inline tempfile-based JSON writes in popular.py with write_json_atomic()
- Remove dead reload_model_list() from model_list.py
- Fix workflow_analyzer.py hint prioritization for diffusion_models vs specific output hints
2026-06-25 18:54:59 +02:00
Dariusz L 6850ef1267 refactor: centralize type coercion and file I/O helpers to eliminate duplication 2026-06-25 17:33:59 +02:00
Dariusz L d979bbcf21 refactor: extract shared utilities and deduplicate metadata path definitions
- Add first_non_empty() and to_int() to core/type_utils.py
- Add get_filename_from_path() and METADATA_DIR to core/path_utils.py
- Replace inline implementations across resolver, downloader, and sources
with calls to the shared utilities
- Move strip_known_model_extension from resolver to matcher
2026-06-25 17:00:27 +02:00
Dariusz L 8655f92515 refactor: centralize category mapping and atomic JSON writing 2026-06-25 16:45:55 +02:00
Dariusz L 8f890f6992 refactor: centralize path utilities in core/path_utils
Extract repeated path normalization and identity logic from __init__.py,
core/resolver.py, core/downloader.py, and core/scanner.py into a shared
core/path_utils module. Also add a loading state to the local model picker
so it waits for models to load before rendering options.
2026-06-25 01:23:20 +02:00