Commit Graph
42 Commits
Author SHA1 Message Date
Dariusz L 13fbacdf4b Attach drag handle events for Linker dialog
Add attachDragHandleIfNeeded() and call it when opening the dialog. The new helper binds a single mousedown listener on #model-linker-drag-handle (and a one-time document mouseup) to start dragging, set cursor state, and avoid attaching multiple times. It also skips drag behavior in fullscreen and safely no-ops if the handle element is missing.
2026-04-21 12:43:37 +02:00
Dariusz L 718e01a491 Improve MLFilterSwitch DOM handling
Make MLFilterSwitch more robust by guarding against a missing filter button and caching the element reference before toggling active state. Use getAttribute('data-...') instead of dataset for consistent data access, and adjust child DIV indexing to account for a category header so active/inactive sections are selected correctly. Add comments and clearer variable names for maintainability.
2026-04-19 21:08:33 +02:00
Dariusz L 994d68d958 Add queued model resolutions & combo picker
Introduce queuing of model resolutions and a compact combo-style all-models picker. Adds updateSelectedBarForMissing and removeQueuedByKey to show/remove queued selections per missing slot and rebuild pending index after changes. Change individual match buttons (including alternative matches) to queue selections instead of immediately resolving, and wire remove button to key-based removal. Replace the old multi-select search with a debounced dropdown list that shows folder info, supports click-to-queue, focus/blur behavior and a refresh button to reload all models. Also insert a visible selected-bar element into the slot UI and adjust various handlers and logging to reflect the new workflow.
2026-04-19 18:59:02 +02:00
Dariusz L 1abf542a58 Add node locate/focus feature to linker
Introduce locateNodeInGraph in LinkerManagerDialog to center, select, and highlight nodes in the ComfyUI canvas with compatibility fallbacks for different app versions and error notifications. Add a 'Locate' button to node headers (top-level nodes only) and wire its click handler so the UI will focus the corresponding node. Improves UX for finding and inspecting missing or referenced nodes.
2026-04-19 18:06:21 +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
Dariusz L d7e88e7dcf Add queue, drag/resize, and fullscreen to linker UI
Redesign the Model Linker dialog to improve UX: add a draggable window, fullscreen toggle, resizable two-column layout with a splitter, and a persistent queued selection panel for batching model resolutions. Implements queue management (queueResolution, applyPendingResolutions, remove/clear queued items), a searchable "all models" dropdown (debounced filtering, loaded via /model_linker/models), and batch apply via /model_linker/resolve. Persists UI state (position, size, fullscreen, splitter width, collapsed state) to localStorage and updates header/footer controls and styles. Also includes helper utilities (debounce, ensureAllModelsLoaded) and various UI wiring to keep selection bars and buttons in sync.
2026-04-19 15:59:41 +02:00
Dariusz L dd320047e0 Default to Missing tab and add category headers
Add a visual category header to each model section in the Linker dialog and ensure the dialog defaults to the "Missing Models" tab when opened. Also skip rendering the missing-models list when the active tab isn't "missing" to avoid unnecessary DOM work. Minor UI tweaks include toggling tab classes and showing download/auto-resolve buttons when switching to the missing tab.
2026-04-18 03:22:47 +02:00
Dariusz L 259e491c96 Handle LoraManager lora detection and updates
Filter out LoraManager (LoraLoaderV2) entries that already exist locally so they don't appear as missing, and skip matching for those entries. Integrate scanner data to detect local lora files (full_path/exists) in workflow analysis. Add special handling in update_model_path/update_workflow_nodes to update LoraManager lora lists and the formatted lora text widget (widgets_values[2] and [1]) when a new lora is resolved, using mapping fields is_lora_v2 and original_lora_name. Improve convert_to_relative_path and get_base_directory_for_model to prefer folder_paths lookup and preserve exact ComfyUI filename formats. In the web UI, make resolve button IDs unique by including a missingIndex, avoid duplicate listeners, forward is_lora_v2/original_lora_name to the resolve API, and add extra logging for debugging.
2026-04-18 02:51:06 +02:00
Dariusz L 50fe87c99d Support LoraV2 active/inactive and UI filters
Add support for text-based Lora loaders (LoraLoaderV2 / LoraManager) and mark model refs with activity/connection state, plus UI improvements.

- __init__.py: clarify comment and propagate new flags from refs (is_lora_v2, active, connected).
- core/workflow_analyzer.py: reformatting and small style changes; add LoraLoaderV2 and LoraManager node hints; detect node connected/bypassed state; parse text-based Lora widget lists (name/strength/active) and emit model refs with strength, is_lora_v2, active and connected flags; include connected flag for URN and file refs; keep existing URN/file resolution and dedup logic but annotate refs with subgraph/context info.
- web/linker.js: group loaded models into active/inactive per-category, add UI filter buttons (All / Active / Inactive), separate copy buttons for active/inactive/all, update display to indicate active vs inactive models and copy behavior, and add global helper functions for filtering and clipboard operations.

These changes enable accurate detection of LoraV2 loader states and provide a clearer UI for copying model spec strings while preserving existing behavior for standard loaders.
2026-04-18 01:12:10 +02:00
Dariusz L 25b424bab9 Add Loaded Models API and UI tab
Add a new POST /model_linker/loaded API that analyzes a workflow JSON to extract all referenced models (including URNs, embedded node.properties.models and Lora strength extraction) and returns a structured list of loaded models. Update the LinkerManagerDialog UI: add tabs (Missing Models / Loaded Models), styles for the loaded models view, tab switching logic, and new functions to load and render loaded models grouped by category with copy buttons and a consolidated copy-all string. Also hide download/auto-resolve controls when viewing the Loaded Models tab and adjust header layout to accommodate the tabs. Error handling and logging were added for robust API behavior.
2026-04-18 00:21:09 +02:00
Dariusz L 8f9597eb10 Show filename and expandable other matches in linker
Display the expected filename in the missing-item title and enable wrapping for node/category chips. Remove the duplicated filename row and make the "other matches below 100%" note expandable: clicking it toggles a hidden list of alternative matches. Each alternative now shows a confidence badge, truncated filename/path with tooltip, and a Link button that triggers the existing resolve action. These changes improve readability and UX when many matches are present.
2026-04-17 23:50:50 +02:00
Dariusz L c703a26317 Link CivitAI model pages and improve labels
Wrap missing file title in a CivitAI link when a URN is available, and construct a modelUrl from URN info. Make model/version labels clickable and highlight them (orange) when linking to CivitAI; otherwise fall back to muted text. In the found-on-CivitAI section, build a display name that includes the version when present, render it as a styled button that opens the CivitAI page, show the model type in muted text, and use expected_filename or fallbacks for downloads. Removed the previous separate "View" link in favor of the unified clickable model label/button.
2026-04-17 23:14:35 +02:00
Dariusz L 3ab6a9cc55 Enhance Model Linker routes, downloader, and linker
Refactor and harden the Model Linker extension: normalize string quoting/formatting and improve logging and error responses across API routes. Make route registration more robust to missing PromptServer and dependencies. Add/expand download-related features: safer request parsing (including is_urn handling), CivitAI URN support & direct download URL resolution, popular/model-list/HuggingFace/CivitAI search fallbacks, improved header handling for HF/CivitAI, and better category/directory mapping. Improve downloader reliability and UX: folder_paths fallback, pre-initialize download progress entries, smoother speed calculation and CLI logging, cancellation cleanup on Windows, stronger exception handling, and consistent JSON responses from endpoints.
2026-04-17 21:23:25 +02:00
Dariusz L e8939d4bf1 Add URN (ComfyUI-AIR) resolution via CivitAI
Detect ComfyUI-AIR URNs in workflows, resolve them to expected filenames via the CivitAI API, and prefer those filenames for matching.

Key changes:
- core/workflow_analyzer.py: added URN_REGEX, URN_TYPE_MAP, is_model_filename() now recognizes URNs, and get_node_model_info() emits structured URN info (is_urn, urn fields, category, exists=False).
- core/sources/civitai.py: added resolve_urn(model_id, version_id) with caching, API fetch of model/version and primary file, and result shaping (model_name, version_name, expected_filename, files).
- core/linker.py: import resolve_urn and call it for missing URNs, attach civitai_info/expected_filename, and prefer expected_filename as matching target; cleaned up deduplication logic.
- web/linker.js: UI shows URN original plus resolved CivitAI model/version labels where available.
- TODO.md: added plan/notes for URN detection and next steps.

This improves detection and fuzzy matching for models referenced by URNs so missing model resolution is more accurate. Further matcher and updater enhancements remain TODOs.
2026-04-17 18:55:55 +02:00
unknown c4ef3919dc Redesign UI with improved visual hierarchy and UX
- Add CSS variables and global styles with custom scrollbar

- Implement two-column layout (Local Matches / Download)

- Add confidence badges with color coding

- Smart filename truncation with hover tooltips

- Consistent button styling with icons

- Sticky footer with backdrop blur

- Status alert containers for errors/success

- Best match highlighting for 95%+ confidence

- Hide Auto-Link button when no 100% matches

- Fix race condition in auto-resolve flow

- Wider dialog (1100px) for full filenames
2026-01-19 01:35:10 +01:00
unknown 7e805bf553 Add auto-resolve buttons to ComfyUI Missing Models popup 2026-01-19 00:51:31 +01:00
unknown d03d8545a3 Add bulk download and cancel all functionality
- Add Download All Missing button to download models without local matches

- Button toggles to Cancel All (N) during active downloads

- Fix notification showing null for info type messages

- Preserve download state when dialog is closed and reopened

- Show downloads in progress message instead of all available during downloads
2026-01-18 23:45:44 +01:00
unknown 91acff7c78 Enhance download system with speed display, workflow URLs, and UX improvements 2026-01-18 15:59:27 +01:00
unknown 2843373c58 Add download integration with auto-search on startup 2026-01-18 05:44:31 +01:00
unknown c7cdf78e60 Add Ctrl+Shift+L keyboard shortcut to open Model Linker 2026-01-18 03:45:08 +01:00
unknown 6935f5e598 Fix UI button for updated ComfyUI
Use ComfyButton/ComfyButtonGroup component system with dynamic imports to properly integrate with the new ComfyUI menu. Falls back to floating button for legacy versions.
2026-01-18 03:42:16 +01: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 5d9203ec74 Add multiple resolve buttons and normalize path separators in matching logic 2025-11-05 15:39:00 +01:00
unknown 9dc47faf1b Update README with demo video 2025-11-04 21:19:19 +01:00
unknown efbf5f49db Update README: Add demo video link 2025-11-04 21:14:53 +01:00
unknown 32b7b74ff5 Add demo video to README 2025-11-04 20:52:02 +01:00
unknown a9acf5e02c Add __pycache__ to gitignore and remove from tracking 2025-11-04 16:23:48 +01:00
unknown e7fd4203c4 Improve Model Linker UI: prevent text line-breaking and add resolve button for highest confidence matches 2025-11-04 15:23:25 +01:00
unknown da3ce0f472 docs: Remove demo video section from README 2025-11-04 03:18:51 +01:00
unknown 1deff7f336 docs: Fix demo video display - use direct link instead of HTML5 video tag 2025-11-04 03:14:52 +01:00
unknown b3b14b647f docs: Add demo video section to README 2025-11-04 03:10:59 +01:00
unknown ab2f1011f0 docs: Add demo video to README 2025-11-04 03:08:32 +01:00
unknown 758ab0d2dc fix: Update workflow in place instead of creating new tab for resolve and auto-resolve 2025-11-04 02:12:33 +01:00
unknown 8463bd2db6 docs: Update DISCORD_LAUNCH_POST and README formatting 2025-11-04 02:01:22 +01:00
unknown f6370c54fe docs: Update README 2025-11-01 19:56:59 +01:00
unknown d8ea841e4a docs: Update README 2025-11-01 19:52:07 +01:00
unknown 9bacf22178 docs: Revert README to version without image 2025-11-01 19:49:13 +01:00
unknown adddc69563 docs: Add screenshot image to README 2025-11-01 19:45:41 +01:00
unknown eb61ffa045 docs: Add screenshot image to README 2025-11-01 19:42:50 +01:00
unknown 98287a7065 docs: Add model linker screenshot and Discord launch post 2025-11-01 19:32:36 +01:00
unknown a6e44ace44 docs: Simplify README feature description 2025-11-01 19:17:09 +01:00
unknown 7b972d6dfa chore: Rename comfyui-Model-Linker to comfyui-model-linker (kebab-case) 2025-11-01 19:15:03 +01:00