Commit Graph
39 Commits
Author SHA1 Message Date
Dariusz L 467b1987e1 Improve LoRA model strength detection across workflow analysis and UI 2026-07-24 17:57:27 +02:00
Dariusz L 668cecea2d Make resolver workflow model selection survive analysis timing
Queue workflow model reference selection requests in the dialog, wait for
workflow analysis to complete before attempting selection, and handle
superseded or timed-out requests gracefully.

- Track pending selection requests on the dialog with status fields
- Apply queued selections from lifecycle graph methods after analysis
- Await loadWorkflowData/loadLoadedModels so the caller can proceed
  after tab content is actually ready
- Add timeout handling with user-visible warnings when selection cannot
  complete
- Cover queueing, superseding, waiting, and completion in JS tests
2026-07-24 16:00:10 +02:00
Dariusz L 854cb2c08c track explicit search sources and gate local database download visibility 2026-07-22 13:25:33 +02:00
Dariusz L 5362cb17a3 refactor: remove dead code and add isAutoOpenEnabled helper 2026-07-18 14:01:05 +02:00
Dariusz L 2987c036e2 refactor: unify settings schema and dynamic node rules exposure across backend and frontend 2026-07-18 10:21:49 +02:00
Dariusz L 28d24214aa fix: improve resolver error propagation, sanitization, and consistency 2026-07-16 11:11:48 +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 9c0ec8b26b Add progress reporting for loaded model and workflow analysis
- Add server-side loaded models progress tracking in __init__.py
- Report workflow node analysis progress from workflow_analyzer.py
- Add frontend polling, rendering, and UI flow for loaded models progress
2026-07-03 00:06:04 +02:00
Dariusz L b7e7b1b295 refactor: centralize getModelCardUrl and HTML/URL utilities in resolver/utils 2026-07-02 04:18:04 +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 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 d49ae0becc refactor: centralize API calls through ResolverManagerDialog.fetchJson
Replace scattered api.fetchApi(...) + response.ok + response.json() boilerplate
across all web/modules with a unified this.fetchJson() helper defined on the
base dialog class.

Changes:
- dialog.fetchJson(url, options, context) handles headers, status checks, and
  JSON parsing in one place
- Extracts server-side error messages (errData.error) for better UX
- Optional silent flag suppresses notifications for background/refresh requests
- All callers simplified: async return, shorter bodies, consistent error handling
- BOM removed from workflow_update_methods.js and tabs_loaded_methods.js
2026-06-25 02:01:18 +02:00
Dariusz L c5c3490210 feat: add auto-refresh of ComfyUI model catalog after Apply 2026-06-24 19:22:55 +02:00
Dariusz L 8c0168ab76 feat: skip model analysis for empty or non-model workflows
Add early-return optimizations so both backend and frontend avoid unnecessary
URL extraction and disk scanning when a workflow has no nodes or contains
no potential model references.

Also tighten API input validation by rejecting non-object workflow_json.
2026-06-24 03:46:50 +02:00
Dariusz L d8124d03da feat: add live backend search progress tracking
Frontend now polls a new backend endpoint (/model_resolver/search-progress/{progress_id})
to display real-time, per-source progress messages and percentages during model searches,
replacing static 'Searching...' indicators with granular status updates.
2026-06-23 02:23:45 +02:00
Dariusz L b4cd98e1ca Refactor missing model key generation and DOM ID generation
- Centralize model key logic: replaced inline key construction across 5 files with
  getMissingModelKey() and new getMissingModelDomKey() helpers in lifecycle_graph_methods.

- Extend getMissingModelKey(): now incorporates nested_key, category, and an identity
  field (original_lora_name, original_path, expected_filename, name, filename, urn_string)
  so that distinct models within the same subgraph produce unique keys.

- Fix duplicate DOM ID collisions: getMissingModelDomKey() encodes the full key as a
  URL-safe base64 string for all element IDs (local-matches-body, selected-bar, combo,
  locate, local-matches-refresh, selected-apply, selected-remove), preventing collisions
  between subgraph instances that share a node_id/widget_index.

- Store missing_key on resolution objects in queue_methods to keep the canonical key in
  sync between queue and browser views.
2026-06-22 03:27:22 +02:00
Dariusz L ff95a2bd1e Make node locate race-safe and graph-switch-aware 2026-06-22 00:18:41 +02:00
Dariusz L 4f91accbab feat: improve model scan cache override, combo UX, and filename handling
- Add force_rescan end-to-end so callers can bypass the short-lived local model scan cache: backend entry in __init__.py and core/resolver.py, lifecycle_graph_methods forwards it through the workflow analysis body, and download_target_methods passes ?force=1 from the refresh flow.
- Rewrite combo dropdown lifecycle in missing_browser_methods with show/hide helpers, pointer-capture tracking, and a capture-phase outside-click listener so the list stays open during drag/hover and closes reliably otherwise.
- Animate refresh buttons (CSS keyframes + JS Web Animations) with reduced-motion fallback.
- Encode selected model path into the selected-bar data-model attribute and wire contextmenu so users can open the containing folder from the selection.
- Fix XSS risk in selected-bar label by escaping label HTML; change queue/selected Remove buttons to danger style.
- Increase max missing-browser model column width clamp from 430 to 820 and stop truncating missing-filename display; show full filename with tooltip instead.
- Update huggingface-author-index.json metadata timestamp/counts (1 file changed, 1 line).
2026-06-19 03:57:40 +02:00
Dariusz L 5f1e814751 feat: support subgraph-aware node location and widget model context
- workflow_analyzer: refactor widget category hint resolution and add widget name candidate extraction across widgets, inputs, proxyWidgets, and localized names; expose new helpers get_widget_name_candidates/get_widget_name_hint
- workflow_analyzer: add get_model_widget_category_hint and get_effective_model_category_hint to unify category fallback logic
- workflow_analyzer: include widget_name on model refs emitted by get_node_model_info
- workflow_analyzer: introduce promoted-widget context resolution (_build_promoted_widget_contexts, _find_promoted_widget_targets, etc.) and wire it into analyze_workflow_models so instance widgets and promoted widget locators are tracked with subgraph scope
- lifecycle_graph_methods: refactor locateNodeInGraph into subgraph-aware resolver using findLocateTarget/getGraphNodeById/findSubgraphById/findNodeInGraphTree; support targeting nodes inside specific subgraphs with proper canvas focus and notifications
- missing_browser_methods: use unified getMissingLocateTarget for locate button/display fields; pass subgraphId and isTopLevel to locateNodeInGraph; add promoted-widget-aware tooltips and canLocate handling
2026-06-19 01:39:15 +02:00
Dariusz L 6de0668c4b feat: add sams and ultralytics model categories
Add support for Two new model categories with full frontend and backend
integration:

- sams: maps sam, sam_model, sam_models → sams category
- ultralytics: maps ultralytics, ultralytics_bbox, ultralytics_segm, yolo → ultralytics category

Covers CATEGORY_MAP, settings templates/aliases, workflow_analyzer node hints,
download target resolution (JS), and folder detection.
2026-06-19 00:44:36 +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 47d286620f feat: add configurable download path system with templates and mappings
Implements a new download path configuration UI and backend logic:
- Add Subfolder fill mode: Suggested (existing), Template, Manual
- Add Base Model Path Mappings to override detected base-model folders
- Add Default Root settings to control root directory per category
- Add Detect From Existing Folders button that infers templates and mappings from local model folders
- Add backend /model_resolver/root-directories and /model_resolver/path-template-suggestions routes
- Refactor resolver settings into core/settings.py for shared frontend/backend use
- Extract path template inference logic into core/path_templates.py
- Update download panel, context menu, and loading flow to use new path settings
2026-06-19 00:09:58 +02:00
Dariusz L 9399f52033 Preserve local matches and download target selections across workflow changes 2026-06-18 02:46:33 +02:00
Dariusz L c9dd0e47ac feat: improve model resolution for extensionless workflow values and add new node type support
- Add model_title match type for CivArchive and CivitAI sources, resolving
  extensionless workflow values by title similarity (threshold 82.0)
- Recognize new node types and widget indices across model categories
  (GGUF, CLIP, ControlNet, StyleModel, Hypernetwork, etc.)
- Scan known model combo widget indices even when the stored value has no
  file extension, treating non-placeholder strings as model references
- Strip known model extensions during workflow URL lookup so filename stems
  match regardless of extension
- Update HuggingFace author index metadata
2026-06-18 02:19:14 +02:00
Dariusz L a4d5bd4c5c feat(logging): add frontend/backend log controls, unify console logging
- Add frontend_logs_enabled/frontend_log_level and backend_logs_enabled/backend_log_level
  toggles and selectors in the Options panel (web/resolver/views/options_methods.js)
- Sync frontend logging settings from localStorage / server settings into the
  frontend logger on startup and settings load (download_target_methods.js)
- Apply backend logging settings from server settings in the Python backend
  (__init__.py), loading control state on startup and after saves
- Make frontend Logger resilient to stored configs that lack an 'enabled' flag
  and to legacy/invalid moduleSettings levels (logger.js)
- Guard default module logger level initialization against undefined settings
  (log_funcs.js)
- Replace scattered console.log/usages with module-level log.debug calls across
  resolve_download_methods.js, model_resolver.js, and workflow_state_methods.js
- Bump log system package version to 1.5.6 (core + web)
2026-06-17 01:51:29 +02:00
Dariusz L 40b1108bd2 feat: expand multi-ref pending resolutions and fix race conditions in loaded/missing tabs
- Add getResolutionQueueKey, getResolutionNodeRefs, and expandPendingResolutionsForApply helpers in queue_methods.js so each queued resolution can carry multiple node refs and be fully resolved before apply.
- Store node_refs, is_lora_v2, original_lora_name, and nested_key on pending resolutions; expand them during apply, with a guard for empty selections.
- Introduce optimistic analysis updates (applyOptimisticAnalysisData + getOptimisticAnalysisDataAfterApply) so the missing/loaded views refresh immediately after apply, then refresh in the background via refreshAnalysisInBackground.
- Update notification messaging to reflect expanded reference counts.
- Fix race conditions in lifecycle_graph_methods.js and tabs_loaded_methods.js by assigning load tokens only after the async workflow-load path begins, so early returns no longer clobber the token and stale panels are suppressed.
- Minor README badge styling fixes: add labelColor=111827 and update the Python badge to an SVG-based asset.
2026-06-17 01:06:51 +02:00
Dariusz L d4d1715f8a fix(web): prevent stale workflow refreshes and improve signature detection
- Guard workflow-tab-click handler with setTimeout and generation ownership check to avoid stale state updates
- Add generation-based refresh cancellation so outdated retry attempts are discarded
- Expand workflow signature to detect more model reference types, normalize widget values, and include subgraph definitions
2026-06-17 00:29:59 +02:00
Dariusz L 38874f5d99 feat: centralize download progress UI state and re-render on view reconnect 2026-06-12 18:01:07 +02:00
Dariusz L e61c868038 fix: prevent stale tab renders by scoping workflow and loaded models data loading to their respective tokens 2026-06-07 18:37:00 +02:00
Dariusz L b7c4f47e90 feat: add auto-fill base model toggle to control default search behavior
Adds a new 'Auto-fill model filter' setting under Search Defaults that
controls whether new searches default to 'Auto' (detecting the workflow
base model) or 'none' (Any model). The preference is persisted in
localStorage as ModelResolver.autoFillBaseModel and is respected across
search panel initialization, base model dropdown defaults, workflow state
cloning, and dirty-state checks.
2026-06-07 18:02:42 +02:00
Dariusz L ab59cd231f feat: add base model filtering across search sources, API routes, and frontend UI 2026-06-06 19:43:43 +02:00
Dariusz L 7bd1b9ad33 feat: persist download target subfolder selections and add suggest button 2026-06-06 18:18:58 +02:00
Dariusz L df8433457c feat: add per-workflow search state caching and background job deduplication 2026-06-06 02:54:59 +02:00
Dariusz L 1ed4941b6b feat: improve workflow tab click detection and stable graph signing
- Add isLikelyWorkflowTabClickTarget to distinguish workflow tab clicks
  from generic document clicks, preventing false 'workflow-change'
  triggers and unnecessary refresh cycles.
- Add getWorkflowSignatureData to produce a stable, normalized signature
  for workflow data (sorted nodes/links, top-level signature included).
- Update document-click handler to use a new 'workflow-tab-click' reason
  via the click-target heuristic.
- Simplify refreshForActiveWorkflowChange retry logic by removing the
  pending-graph-switch special case, since click origin is now explicit.
2026-06-06 02:11:15 +02:00
Dariusz L 145b061c78 fix: improve workflow change detection and graph signature stale checks
- Patch app.loadGraphData to dispatch custom event after loading,
  ensuring workflow handlers fire when switching active workflow
- Add document-click handler to catch workflow changes initiated by clicks
- Pass event options through removeEventListener for proper cleanup
- Detect possible pending graph switch on document-click and reduce
  max refresh attempts from 8 to 3 to avoid stale graph timers
2026-06-06 02:06:09 +02:00
Dariusz L 827017f7a0 Revert "revert: remove server-side settings persistence and revert to localStorage-only"
This reverts commit 888ab171c3.
2026-06-05 06:03:41 +02:00
Dariusz L 888ab171c3 revert: remove server-side settings persistence and revert to localStorage-only
The previous commit introduced server-side persistence for API keys and
preferences via a model_resolver_settings.json file and POST/GET routes.
This change reverts that behavior, returning to localStorage-only storage
for settings, which is simpler and avoids persisting sensitive credentials
to disk. Also removes the now-unnecessary .gitignore entry.
2026-06-05 06:03:04 +02:00
Dariusz L 96d6456310 feat: add server-side settings persistence for API keys and preferences 2026-06-05 06:00: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