Commit Graph
432 Commits
Author SHA1 Message Date
Dariusz L 59e61ba077 refactor: centralize progress reporters, default user-agent, improve error propagation and aria2 fetch usage 2026-07-02 02:54:38 +02:00
Dariusz L f428924ee0 fix: normalize table cell borders in search results
Add border: none reset and restructure border-bottom declarations to
ensure consistent border rendering across search result table cells.
2026-07-02 02:47:12 +02:00
Dariusz L 11ec45526c refactor: consolidate duplicated path and size utilities
Extract MODEL_EXTENSIONS and format_size_bytes into core/type_utils, removing duplicates from workflow_analyzer and downloader. Add getFilenameFromPath to render_format_methods and replace inline path-splitting logic across JS resolver actions, search, and views.
2026-07-02 02:27:53 +02:00
Dariusz L 01f0ea1194 feat: improve hash comparison UX with source labels and success notifications
- Add getHashCompareSourceLabel to normalize source display names
- Add getHashCompareResultName and getHashCompareResultUrl helpers
- Collect and dedupe hash compare matches instead of returning boolean
- Show success notification listing matched sources when local model hash matches online results
2026-07-02 02:18:21 +02:00
Dariusz L 2078d870b3 refactor: centralize path normalization and extract common options task handler
- Introduce normalizePathToForward/normalizePathToBackward helpers in render_format_methods.js
- Replace inline path normalization regex across 6 files with shared helpers
- Extract executeOptionsTask helper in options_methods.js to deduplicate repeated async loading/error/success handling and add missing error notifications
2026-07-02 02:12:40 +02:00
Dariusz L d97450f119 refactor: extract splitter drag logic into shared utility
Replace duplicated inline drag handlers in queue_methods.js and
missing_browser_methods.js with a new startSplitterDrag() helper in
web/resolver/utils/splitter_drag.js.

The utility centralizes pointer/mouse event binding, RAF throttling,
and touch-cancellation cleanup, cutting net code across the two
callers while preserving existing behaviour (bounds, edge-open
threshold, collapse preview, and settle/cleanup timing).
2026-07-02 01:57:37 +02:00
Dariusz L dc7ed980b9 refactor: deduplicate progress tracking and unify hash polling logic
- Introduce JobProgressTracker in __init__.py to consolidate the duplicated
  thread-safe progress/cancellation state and cleanup logic previously
  implemented separately for search and hash jobs.
- Extract shared pollHashCalculation method in model_info_methods.js to
  centralize hash polling, abort checking, and error handling across all
  call sites.
- Use getMissingModelKey in search_panel.js to eliminate inline key
  construction duplication.
2026-07-02 01:50:19 +02:00
Dariusz L d42df98370 Generalize model source linking from CivitAI-only to multi-platform support (CivitAI, CivArchive, HuggingFace, LoRA Archive) with cached metadata lookups 2026-07-02 01:26:54 +02:00
Dariusz L 88cf8580f7 feat: add local model hash calculation with manual-progress notifications 2026-07-02 00:41:40 +02:00
Dariusz L 1128234bbd feat: add local model hash comparison functionality
Implement end-to-end hash comparison for local models and local matches.

Backend:
- Add /model_resolver/local-model-hashes API endpoint
- Add get_local_model_hash_metadata() to read sidecar SHA256 metadata

Frontend:
- Add Compare Hashes context menu item and CSS
- Pass missing_key/missing_search_key through resolveDownloadMethods
- Enhance local match rendering with hash status and context data
- Add hash normalization, formatting, and candidate collection helpers
- Wire compareLocalModelHashesWithCurrentFinding action

Also update HuggingFace author index metadata.
2026-07-02 00:27:59 +02:00
Dariusz L 1c71b609f3 fix: defer base model mapping refresh during batch load
Avoid redundant refreshBaseModelMappingOptions calls when loading saved
mappings by batching the refresh to a single call after all rows are added.
2026-07-01 23:19:02 +02:00
Dariusz L ea97e36532 fix: guard renderModelTreeNodes calls behind expand state to avoid unnecessary rendering 2026-07-01 23:07:32 +02:00
Dariusz L 113c20c566 perf: optimize missing models browser selection updates
Avoid full list re-render on row selection by passing selectionOnly flag
to displayMissingModels, which now selectively updates row classes and
detail pane instead of rebuilding the entire DOM. Also removed an eager
ensureLocalModelsThenPopulate('') call on combo list presence, and added
a click listener alongside focus so the combo list reliably populates on
both interaction types.
2026-07-01 23:00:37 +02:00
Dariusz L d95c099f5a Improve rendering performance and split drag behavior
- Added CSS content-visibility and contain-intrinsic-size to list row
  containers in resolver-main.css and resolver-shell.css for off-main-thread
  rendering optimization.
- Deferred queue list panel split drag updates to requestAnimationFrame in
  web/resolver/actions/queue_methods.js, reducing redundant DOM writes and
  guarding against duplicate frames during split dragging.
- Deferred missing browser split drag updates to requestAnimationFrame in
  web/resolver/views/missing_browser_methods.js with optional chaining on
  split start values, preventing layout thrashing while dragging.
2026-07-01 22:52:17 +02:00
Dariusz L c9d83f6fe1 Remove scrollbar-gutter: stable from resolver pane
The stable scrollbar-gutter was preventing natural layout behavior
in scrollable container by always reserving space for the scrollbar.
Removing it lets the pane use standard overflow-y behavior.
2026-07-01 21:06:48 +02:00
Dariusz L 26d13c1acc feat: enhance logging system with exception level, aliases, and spaced log levels 2026-07-01 20:58:25 +02:00
Dariusz L 22be853f13 Add FATAL log level to logging system 2026-07-01 20:43:32 +02:00
Dariusz L f11f81b152 Merge branch 'main' of https://github.com/Azornes/Comfyui-Model-Resolver 2026-07-01 20:31:27 +02:00
Dariusz L 21b16389e7 refactor: simplify queue panel open/close logic 2026-07-01 20:29:43 +02:00
Dariusz L c7dcdc848a Add ko-fi funding option for Azornes 2026-07-01 20:09:34 +02:00
Dariusz L 0f62d19490 refactor: simplify queue split drag state management
Remove manual cursor and pointer-event state restoration during queue
resize. The drag now relies on the browser default col-resize behavior
and avoids setting body styles or mr-is-resizing-queue. Guard
applyQueueSplitWidth against redundant style writes and drop unused
parameters from beginQueueEdgeDrag, deferQueueSplitReleaseUi, and
startSplitDrag.
2026-07-01 18:05:16 +02:00
Dariusz L 3c4dfc72e4 feat: refactor queue panel and split layout with deferred reveal and pointer events
- Add PointerEvent support for queue toggle, edge drag, and splitter interactions
- Implement deferred queue panel reveal animation (mr-queue-opening class)
- Make queue panel updates demand-driven; skip refresh when panel is hidden
- Replace per-item remove listeners with event delegation on queue list
- Track queue split container width via ResizeObserver with safe fallbacks
- Centralize split flex application and persist queue width/collapsed state with debounce
- Fix missing browser split pane styles to use helper-track CSS variables
- Add deferred UI cleanup for missing browser split drag end
- Add prewarm frame fallback when ResizeObserver is unavailable
2026-07-01 17:58:05 +02:00
Dariusz L c2b074ce12 fix: improve missing browser split pane resize behavior 2026-07-01 01:23:24 +02:00
Dariusz L ef8ff03743 fix: remove forced download path mode reset on template detection 2026-06-30 23:16:44 +02:00
Dariusz L 25e20eea8f feat: add frontend and backend log export in options 2026-06-30 23:14:37 +02:00
Dariusz L f1e863e495 Normalize module name when __name__ contains OS path separators
ComfyUI may set __name__ to hybrid OS-path values (e.g. 'E:\\...\\comfyui-model-resolver.core.sources.model_list'), which broke the existing split-by-dot logic.

This adds a pre-normalization step that converts path separators to dots, strips drive letters and .py extensions, so _normalize_module_name reliably falls back to DEFAULT_MODULE for unknown path-derived values rather than miscounting segments.
2026-06-30 22:33:41 +02:00
Dariusz L 63518e18b4 fix(logger): reset loggers in configure() to apply new config 2026-06-30 22:16:53 +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 b59be44935 refactor(log): remove legacy standalone log functions and consolidate exports
- Drop manual log_debug/info/warn/error/exception stubs from core/log_system/log_funcs.py
- Remove stale re-exports of create_module_logger/logger from core/__init__.py
- Add core/log_system/__init__.py as the single public entry point for the log system
- Update huggingface-author-index metadata
2026-06-30 21:34:25 +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 a04c294c55 Bump log_system version to 1.5.7; conditionally resolve use_colors from env/config 2026-06-30 06:00:21 +02:00
Dariusz L 5301bbbb6d Improve log system robustness with safer handlers and simplified color config 2026-06-30 05:35:01 +02:00
Dariusz L cf90841789 feat(log_system/logger): enable Windows console ANSI colors and fix color formatting 2026-06-30 04:28:33 +02:00
Dariusz L 41f0f6c7b4 Use shared global notification container across custom nodes
Add SHARED_CONTAINER_ID constant so the toast container is no longer namespaced per-node.

This allows different custom nodes or projects to stack notifications in one container.
2026-06-30 01:27:52 +02:00
Dariusz L 24db5ed54c refactor: centralize notification handling into shared utility 2026-06-30 01:08:11 +02:00
Dariusz L 54f861a02e feat: add aria2 daemon start/stop control and install migration
- Add /aria2/start and /aria2/stop API endpoints for explicit daemon lifecycle control
- Track aria2 daemon state (managed/running/version/active_transfers) in get_aria2_status
- Implement idle auto-stop timer (5 minutes) with aria2_auto_stop_daemon setting
- Add start_aria2_daemon() and stop_aria2_daemon() helpers in core/downloader.py
- Migrate legacy release-* install directories to normalized versioned paths
- Normalize aria2 version strings (strip release-/v prefixes) in installer metadata
- Update aria2 archive extraction to extract-to-temp then copy into canonical dir
- Add frontend daemon controls: status display, stop button, auto-stop toggle
2026-06-30 00:03:08 +02:00
Dariusz L 8b15500ce4 Add automatic aria2 binary installation support
- New core/aria2_installer.py module downloads the latest aria2c release
  from GitHub for Windows, macOS, and Linux with safe path extraction.
- New POST /model_resolver/aria2/install endpoint triggers installation
  and saves the resolved aria2c_path plus download_backend=aria2.
- Options UI adds an Install aria2 button, hides aria2-specific fields
  when another backend is selected, and updates status on completion.
- Includes .gitignore entry for tools/aria2/ so installed binaries are
  not committed.
2026-06-29 21:55:27 +02:00
Dariusz L 5f1b53e41c Add option to show/hide auto-download capable models in missing browser 2026-06-29 20:54:54 +02:00
Dariusz L 378f82cb25 feat: identify auto-download-capable missing models; add workflow schema inference and badge UI
- Extend dynamic widget category hints to capture choice source (static/hybrid/folder_paths)
- Infer workflow schema model candidates from output category hints when widget values match known presets
- Surface auto_download_capable and auto_download_candidate flags in missing model data
- Merge these flags on duplicate missing model entries
- Add cloud-download badge UI with tooltip explaining auto-download context
- Update huggingface author index metadata timestamp
2026-06-29 20:34:03 +02:00
Dariusz L f780e6507b feat: preserve search state and resolution aliases across workflow transitions
- Propagate missing_search_key through resolution queue and download
  resolution paths so cache lookups remain consistent after workflow
  re-analysis or active searches.
- Set preserveSearchCacheAcrossNextWorkflowSync before reloading
  workflow data following batch queue/resolve operations.
- Remember applied resolu tions (rememberAppliedResolvedSelections)
  after both queue and direct downloads so alias tracking is not lost.
- getMissingSearchKey now short-circuits on missing_search_key and
  search_key fields instead of always deriving from node identity,
  fixing spurious cache misses.
- Guard settleInactiveSearchProgress so non-active workflow states
  only update the cache when the active workflow hosts a matching
  background search job.
- After workflow analysis, call applyResolvedSelectionAliases
  so analysis data reflects user selections.
- When switching workflows, clone and merge the previous workflow
  search-result cache and migrate background search jobs that are
  still running, so active searches are not interrupted or dropped.
2026-06-28 04:04:45 +02:00
Dariusz L 59e874c17f feat: improve CivitAI download support with session tokens and proper headers
- Add __init__.py: support civitai.red domain and session token cookies
- Add core/downloader.py: build_download_headers for consistent User-Agent,
  Accept, and CivitAI-specific Referer/Origin headers across download backends
- Resolve CivitAI API redirects before handing URLs to aria2
- Strip sensitive URL parameters from download logs
- Forward civitai_session_token from the frontend to the downloader
2026-06-28 03:42:41 +02:00
Dariusz L c79e217a42 feat: support grouped download progress for multiple active downloads
- Add getActiveDownloadEntriesForMissing to find all active downloads
  targeting the same missing model entry.
- Refactor resolve_download_methods.js to extract status labels,
  progress markup builders, and snapshot helpers.
- Render multiple concurrent downloads in a grouped progress list
  when more than one download is active for the same missing model.
- Update attachDownloadActionHandlers to resolve downloadId from
  dataset attributes so grouped controls target the right download.
- Add CSS for grouped download progress items in the missing models UI.
- Refresh huggingface-author-index.json timestamp.
2026-06-27 23:51:43 +02:00
Dariusz L aa91d1410c feat: add aria2 download backend with pause/resume support
Integrates aria2c as an alternative download backend alongside the built-in
Python downloader. Adds settings for selecting the backend and configuring
the aria2c executable path, plus a status check button in the options panel.

Backend changes:
- core/downloader.py: aria2 daemon lifecycle, JSON-RPC client, pause/resume
  state machine, and transfer tracking
- core/settings.py: download_backend normalization and aria2c_path setting
- __init__.py: new API routes for pause, resume, and aria2 status checks

Frontend changes:
- options_methods.js: backend selector, aria2c path input, check button,
  and local storage persistence
- resolve_download_methods.js: pause/resume handlers, pending status
  transitions, and progress rendering for aria2 downloads
- queue_methods.js: queue panel pause/resume buttons, backend badge, and
  debounced panel updates
- search_panel.js: actionsHtml support for composite action buttons
2026-06-27 23:39:31 +02:00
Dariusz L e151f9b4c1 fix: normalize download category token before color lookup
Apply normalizeDownloadCategory to the category token before checking
color mappings, preventing unknown-category tokens from falling through
to the default class. Also add clip_gguf to the clip color mapping.
2026-06-27 22:25:55 +02:00
Dariusz L 5571035e23 Replace resolved badge with check icon in missing model rows
- Switch missing model row layout from grid to flex
- Add circleCheckBig SVG icon to icon_utils
- Replace green 'Resolved' text pill with inline checkmark icon
- Update CSS with resolved icon and model details wrapper styles
2026-06-27 22:21:21 +02:00
Dariusz L 4ac05c0228 Make missing-model list header sticky during scroll
Move the .mr-missing-list-head element inside the scrollable .mr-missing-list
container and apply position: sticky so the column headers remain visible when
the list overflows. Adjust grid layout and row alignment rules to support the
new structure.
2026-06-27 20:52:45 +02:00
Dariusz L b73cdb0f40 feat: improve category resolution and missing models browser
- Expand preferred categories to include clip_vision, ipadapter, sams, ultralytics
- Add clip_gguf alias for text_encoders in both backend and frontend
- Add explicit diffusion_models/text_encoders mappings in CATEGORY_MAP
- Refactor get_model_roots to skip custom_nodes/configs, use template key
  aliases, accept new folder keys from known categories, and normalize
  ultralytics paths (yolo/bbox, yolo/segm, yolo -> parent)
- Pass missing object through resolve_download_methods and search_panel
  so category selection can use widget hints
- Refactor frontend download target resolution:
  - getMissingSupportedDownloadCategories respects widget/type hints
  - getNodeTypeDownloadCategory splits exact-node map and adds
    normalizeNodeCategoryToken / getNodeTypeDownloadCategoryFromTokens
    for GGUF and future node families
  - getSourceResultDownloadCategory and _sourceSupportLevel accept
    missing for unified logic
- Prioritize dynamic widget category hints in workflow analyzer and
  include category_hints/folder_key_hints on all model refs
- Add folder count badges and path normalization in missing browser
  (normalizeMissingFolderRootPath handles category suffixes / bbox/segm)
2026-06-27 19:36:47 +02:00
Dariusz L e53d9f2a0b feat: generalize remote metadata lookup across CivitAI, CivArchive, and HuggingFace
Replace CivitAI-only search with a multi-source metadata resolution route using
SHA256 exact-match validation, dead-link filtering, and live download URL
probing. Unify sidecar metadata saving across all remote sources. Add
force-refresh support, local metadata import with preview detection, and
frontend source-aware UI controls.
2026-06-27 03:25:31 +02:00
Dariusz L 3cd302d4ee feat: implement local-only model info fetching and refactor model info dialog
- Add local_only endpoint mode: returns basic file info (filename, size, path,
  location, sha256) without querying CivitAI or computing file hashes
- Validate provided sha256/hash inputs (must be 64-char hex) and fall back to
  empty string when invalid
- Refactor monolithic info response builder into build_info_response() helper
  used across all result paths (local, CivitAI success, CivitAI fallback,
  not-found), reducing duplication
- Add get_model_info_for_file(local_only=True) early return in CivitAI source
  that builds a minimal local-only result without hash lookup
- Split frontend fetchModelInfoForDialog into:
  - fetchLocalModelInfoForDialog: opens dialog with local data immediately,
    marks civitai_checked=false
  - fetchCivitaiModelInfoForDialog: async CivitAI lookup triggered by user
- Add 'Fetch with CivitAI' button in info dialog when local file exists but
  CivitAI has not been checked yet
- Infer model_type from category in both backend and frontend to reduce
  reliance on upstream data shape
- Fix sidecar metadata condition (was skipping save when path already existed)
- Add cursor/disabled styles for info dialog CivitAI link button
2026-06-26 22:16:44 +02:00
Dariusz L 4e576cbd56 feat: add SHA256 hash calculation with cancellation, progress tracking, and remote size probing 2026-06-26 21:51:55 +02:00