26 Commits
Author SHA1 Message Date
Dariusz L ddc5333bd2 refactor: unify model data contracts 2026-08-21 23:10:26 +02:00
Dariusz L 5bfa698282 Unify path identity fallbacks 2026-08-07 15:58:28 +02:00
Dariusz L 75cc40cfb0 refactor: unify model path identity 2026-08-05 05:02:49 +02:00
Dariusz L 0b3c1785c7 refactor: reuse model path identity 2026-08-05 02:10:01 +02:00
Dariusz L c462db3345 refactor: extract workflow inventory 2026-08-02 19:38:35 +02:00
Dariusz L 15e0b932e8 Add shared workflow model inventory cache and improve progress/hash behavior 2026-07-27 17:05:17 +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 8823049f9e refactor: centralize filename extraction, remote URL normalization, and storage abstractions 2026-07-16 10:13:38 +02:00
Dariusz L 7feea3b61e Restrict scanner extension filtering to configured category extensions only 2026-07-14 00:09:59 +02:00
Dariusz L 5de1500537 refactor: consolidate inline mappings and precondition checks into shared helpers 2026-07-04 00:04:22 +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 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 905faa9056 refactor: centralize MODEL_EXTENSIONS in type_utils to eliminate duplication 2026-06-25 16:53:32 +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
Dariusz L b086ffd106 Improve symlink/junction handling and add RapidFuzz for faster fuzzy matching
- Add rapidfuzz as optional dependency with SequenceMatcher fallback
- Use stable path identity (realpath) for deduplication in scanner and resolver
- Prevent duplicate scans and duplicate model entries across symlinks/junctions
- Improve matching performance with RapidFuzz when available
2026-06-22 02:36:40 +02:00
Dariusz L a499af3345 Enable local model matching for resolved models and prevent symlink/junction scan loops 2026-06-22 02:21:24 +02:00
Dariusz L 32d437df50 Expand model category and node type recognition
Add support for additional ComfyUI model types including diffusers, gligen,
style models (latent/regular upscale), audio encoders, background removal,
frame interpolation, geometry estimation, detection, model patches/photomaker,
and optical flow models.

Backend changes:
- Extend CATEGORY_MAP, URN_TYPE_MAP, and node type hints in workflow analyzer
  to cover dozens of new loader node types and singular/plural aliases.
- Add MODEL_OUTPUT_TYPE_TO_CATEGORY and get_node_output_category_hint() so
  loader output types can contribute category hints.
- Make widget name matching normalize underscores, hyphens, and spaces.
- Improve directory discovery to enumerate folders from folder_paths while
  filtering unsupported categories.
- Include folders as model entries in directory scanning (with a diffusers
  guard requiring model_index.json).

Frontend changes:
- Update download target category maps, display names, token name maps, and
  per-node widget index lists to match the expanded backend coverage.
2026-06-19 00:35:06 +02:00
Dariusz L 5a8e68655f refactor: rename Model Linker to Model Resolver
Replace all link dialog terminology with resolver terminology
throughout the codebase, including module names, CSS classes,
IDs, JS variables, SVG gradient IDs, and log module names.
Remove the old web/linker/ tree and introduce the new web/resolver/
tree with parallel structure. Also replace core/linker.py with
core/resolver.py.
2026-06-05 05:53:39 +02:00
Dariusz L e096f2c786 Optimize model matching, caching, and CivitAI URLs
Performance and correctness improvements across model scanning, matching, workflow analysis, and CivitAI URL handling:

- Add short-lived in-memory cache for get_model_files (with force_rescan and invalidate_model_files_cache) to reduce frequent directory scans.
- Pass scanned available_models into workflow analysis to avoid rescanning and build category-indexed lists plus an ordered-candidates cache for faster candidate ordering.
- Improve analyze_and_find_matches to special-case urn:air: URNs (use filename suffix when present) and skip fuzzy matching when appropriate.
- Rewrite find_matches to maintain only the top N results via heapq, cache normalized candidate path/filename values on candidate dicts, and early-exit on max_results<=0 to reduce allocations and CPU.
- Add helper functions in CivitAI source to extract/build stable image page URLs (_extract_civitai_image_id, _build_civitai_image_url) and use them when populating image metadata.
- Propagate available_models into get_node_model_info and analyze_workflow_models so subroutines reuse the same scanned list.
- Guard frontend and backend folder lookups to return early for unknown categories to avoid unnecessary work.

These changes aim to reduce IO/CPU during frequent matching operations and produce more accurate/efficient matching for URNs and local models.
2026-04-24 23:32:00 +02:00
Dariusz L 3687d26f17 Bump log version; use project root for module name
Bump logging version to 1.4.1 and improve module name detection by adding _find_project_root in log_funcs to locate the repository root (searches for a .git directory) and use its basename when LOG_MODULE_NAME is not set, with a fallback to the previous behavior. Also update the same version string in logger.py. Additionally, comment out two noisy debug log lines in core/scanner.py to reduce verbose output when directories are missing or after scanning.
2026-04-22 03:44:41 +02:00
Dariusz L 236ca180e9 Use log_system helpers for module logging
Replace direct uses of the logging module and module-level loggers with the centralized log_system.log_funcs (log_debug/log_info/log_warn/log_error/log_exception) across multiple modules. Updated imports and removed unused logging.getLogger() instances in downloader, scanner, sources (civitai, huggingface, model_list, popular), workflow_analyzer, workflow_updater, and __init__.py. Minor message/text tweaks and import formatting applied; behavior unchanged aside from routing logs through the shared logging helpers.
2026-04-22 00:08:51 +02:00
Dariusz L e8b49dd184 Add AzLogs logging system and integrate
Introduce a new logging subsystem under core/log_system (logger.py, config.py, log_funcs.py) implementing AzLogs (LogLevel enum, colored console output, optional file rotation) and a lightweight wrapper (log_debug/info/warn/error/exception) with safe fallback when AzLogs is unavailable. Integrate these log functions across many core modules (downloader, linker, matcher, scanner, workflow_analyzer, workflow_updater, sources and related files) and export logger and helper log functions from core.__init__. Replace several direct logging calls in linker with the new log_* helpers and update core.__init__ exports. Also include small code style and robustness tweaks (path/filename normalization, JSON/file handling, minor refactors and formatting fixes) to improve matching and model-list/popular lookups.
2026-04-21 23:51:46 +02:00
Dariusz L 0837964874 Add gguf support and nested widget handling
Add support for the gguf model format across the codebase and improve handling of nested/dict-type widget model references. Changes include:

- Add ".gguf" to model extension lists in core/linker.py, core/scanner.py, core/sources/huggingface.py, and core/workflow_analyzer.py so gguf files are detected and suggested.
- Update HuggingFace search/repo listing to consider gguf files and improve some request/response handling and logging.
- Improve scanner implementation: formatting/PEP8 cleanup, robust extension checks, normalized MODEL_EXTENSIONS set, safer path handling, and clearer logging.
- Add NESTED_MODEL_KEYS and logic in workflow_analyzer to detect model filenames stored inside dict-type widget values (e.g. rgthree Power Lora Loader) and record a nested_key for resolution.
- Propagate nested_key through apply_resolution mapping and update update_model_path to write resolved paths back into nested dict keys when present (instead of only replacing the top-level widget value).
- Update web UI (web/linker.js) regexes to strip/display gguf extensions in model name formatting.

These changes allow gguf models to be discovered, resolved and updated in workflows, and enable support for nodes that store model references inside nested dict fields.
2026-04-19 16:43:25 +02:00
unknown 066d4e187f Merge PR #1: Fix tuple unpacking error in scanner.py
Resolves ValueError: too many values to unpack when folder_paths returns 3-tuples.
- Handles both 2-tuple and 3-tuple formats from folder_paths
- Normalizes extensions to set with proper type handling
- Adds better error handling for unexpected formats
- Credit: @gontz
2025-11-05 16:38:51 +01:00
unknown 7b972d6dfa chore: Rename comfyui-Model-Linker to comfyui-model-linker (kebab-case) 2025-11-01 19:15:03 +01:00