Commit Graph
64 Commits
Author SHA1 Message Date
Dariusz L cd7808ee58 style: update UI color scheme to green accent and improve dropdown styling
- Replace blue accent color (rgba(78,161,255)) with green (rgba(114,211,138))
- Update select/input backgrounds to use CSS variables (--ml-border, --ml-panel-bg-strong)
- Add gradient backgrounds and border-radius improvements to dropdown lists
- Increase option padding and add smooth transitions
- Fix select option styling to respect theme variables
- Add enableWheelScrollChaining() to prevent scroll propagation in dropdowns
- Apply wheel scroll chaining to download target and combo autocomplete lists
2026-05-10 06:04:28 +02:00
Dariusz L a54dcf2cc2 web: refine LinkerManagerDialog layout with min-width fixes and responsive breakpoints
- Add min-width: 0 to flex/grid containers to prevent overflow
- Remove bottom padding from options wrapper
- Reduce label widths from 220px to 150px for tighter layout
- Add input min-width: 0 and set input column to minmax(0, 380px)
- Align toggle control to right edge using margin-left: auto
- Adjust number row grid-template-columns to minmax(72px, 118px)
- Introduce responsive breakpoints at 900px and 760px
- Optimize small-screen layouts with reduced gaps and single-column stacking
2026-05-10 05:54:01 +02:00
Dariusz L b30cfdf7b9 feat(UI): add tab persistence and global tooltip system
- Persist active tab selection across dialog sessions via localStorage
- Replace CSS pseudo-element tooltips with centralized global tooltip element
- Add showTooltip/hideTooltip/bindTooltips methods with smart positioning
- Tooltip adapts to viewport edges with max-width constrained to available space
- Cleanup tooltip on dialog close to prevent memory leaks
2026-05-10 05:46:20 +02:00
Dariusz L 132bb10ecb fix(options UI): align dialog elements to top in LinkerManagerDialog
Add align-content: start and align-items: start CSS properties to
.options-content, .options-header, .options-section, .options-stack,
.options-panel, and .options-body to ensure all child elements are
top-aligned instead of being centered or stretched by default grid
layout behavior.
2026-05-10 05:37:06 +02:00
Dariusz L c9a4f8e444 refactor(options): reorganize options UI layout with fixed actions and section visibility
- Move save button and status to fixed bottom actions section in sidebar
- Enable independent scrolling for main content area with custom scrollbar styling
- Implement section visibility toggling (is-hidden) instead of scroll-based navigation
- Restructure grid layout to use flexbox in sidebar for better control
- Add proper height constraints (100%, min-height: 0) to enable scrolling within flex/grid children
- Update mobile breakpoint to adjust sidebar height and border styling
2026-05-10 05:32:30 +02:00
Dariusz L e89cf2d6e6 refactor: reorganize options dialog with sidebar navigation and toggle switches
Replace single-column card layout with two-pane shell (sidebar + main) for
better visual separation between provider sections. Introduce tabbed navigation
between CivitAI and HuggingFace settings.

Replace checkbox rows with modern toggle switches for all boolean search-method
options. Each toggle includes an inline tooltip for immediate context.

Add unsaved-changes status indicator (dirty/saved states) to improve UX.
Remove the separate 'How to get CivitAI session token' expandable help panel;
tooltip now contains concise instructions inline.

Update form layout to use grid-based input rows with consistent spacing and
improved mobile responsiveness via media queries. Adjust colors, borders,
and spacing throughout for a cleaner, more compact appearance.
2026-05-10 05:24:00 +02:00
Dariusz L 9f44f6e59f feat: add configurable CivitAI search method toggles with UI tooltips
- Add civitai_use_trpc_search and civitai_use_html_fallback config options
- Update search_civitai_for_file to conditionally use tRPC and HTML methods
- Include method flags in cache key to respect search method preferences
- Add checkboxes in options UI to control each CivitAI search method
- Add tooltip badges to all API key labels explaining their purpose
- Persist new settings to localStorage and pass through search pipeline
2026-05-10 04:45:47 +02:00
Dariusz L b8515e1441 feat: add configurable HuggingFace search methods with Brave and Comfy-Org fallbacks
- Add new UI toggles for HF search methods: API search, Comfy-Org fallback, Brave fallback
- Integrate Brave Search API as a fallback for finding models on HuggingFace
- Add Comfy-Org author fallback search for authoritative sources
- Refactor HuggingFace search logic into modular helper functions
- Improve filename cleaning to handle fp4 and mixed precision formats
- Add brave_search_api_key, hf_use_api_search, hf_use_comfy_org_fallback, hf_use_brave_fallback settings
2026-05-10 04:27:33 +02:00
Dariusz L 2b94501e20 Improve download target UI layout in LinkerManagerDialog
- Add grid-based layout for download target folder and type selectors
- Apply responsive design with media query for screens ≤720px
- Align labels consistently using flexbox for better visual alignment
2026-05-10 02:33:17 +02:00
Dariusz L f8b5c70f40 feat: show huggingface link 2026-04-26 04:00:45 +02:00
Dariusz L 88b490bfb3 Refine options layout and action buttons
Group the `Options` tab into separate CivitAI and HuggingFace sections for a cleaner vertical layout. Also rename the save action to `Save` and apply the shared footer button styling for visual consistency.
2026-04-26 03:51:07 +02:00
Dariusz L c2ed582254 Unify search icons in model linker UI
Replace text-based search emoji icons with a shared SVG icon for a more consistent UI. Also shorten the main search button label from Search Online to Search.
2026-04-26 03:43:35 +02:00
Dariusz L 51689f29a9 Hide LoRA archive source when unavailable
Add a capabilities endpoint and use it in the frontend to show the LoRA Manager Archive source only when comfyui-lora-manager and its archive database are available. This keeps the source menu clean and avoids exposing unavailable functionality.
2026-04-26 03:37:42 +02:00
Dariusz L f4f28fc450 Add configurable CivitAI candidate limit
Allow the number of CivitAI search candidates to be configured (default 5, bounds 1–20) and thread this limit through the frontend and backend. Backend: introduce DEFAULT/MAX constants, validate candidate_limit, include it in cache keys and logs, collect and deduplicate candidates from tRPC and HTML searches up to the limit, prefer exact 100% matches and otherwise pick the best-confidence result. Frontend: persist civitaiCandidateLimit in localStorage, add an input to options UI, clamp/save the value, include civitai_candidate_limit in search payloads, and apply suggested subfolder info from returned civitai_search_result. Misc: UI copy updated and minor log/message tweaks.
2026-04-26 03:09:03 +02:00
Dariusz L ef567a449e Add token visibility toggles and CivitAI help
Add UI and behavior for showing/hiding API tokens: new CSS (.ml-options-input-row, .ml-options-visibility-btn), visibility buttons next to CivitAI, CivitAI session and HuggingFace inputs, and JS helpers (getVisibilityIcon, syncVisibilityToggle, bindVisibilityToggle) to toggle input type and update button state/aria attributes. Introduce an inline help button and expandable help panel with step-by-step instructions for obtaining the __Secure-civitai-token and an "Open CivitAI" action. Remove the Clear Tokens button from the actions and its previous handler. Overall improves UX for managing and understanding token usage while keeping tokens stored locally.
2026-04-26 02:55:09 +02:00
Dariusz L 233ed15222 Add CivitAI session token & clear search cache
Add support for an optional CivitAI session token and cache-management for search results. UI: new input for __Secure-civitai-token saved to localStorage (modelLinker.civitaiSessionToken) and cleared via the options dialog; saving/clearing tokens triggers a backend cache clear and updates notifications. Backend: add clear_search_cache() helpers in core.sources.huggingface and core.sources.civitai, register /model_linker/clear-search-cache route to flush both caches, and wire the civitai session token into search flows. CivitAI changes include sending the session token as a Cookie header for tRPC searches, incorporating session and model_type into the search cache key, and passing session_token through search_civitai_for_file and related calls. Purpose: ensure authenticated/session-aware search results (including NSFW/visibility differences) and avoid stale cached search results after token/settings changes.
2026-04-26 02:34:26 +02:00
Dariusz L cf0cd8491a Refactor search result rendering into helpers
Add formatSearchResultMeta and renderOnlineSearchResultCard helper methods to web/linker.js and replace repeated HTML construction for online search results (Popular, Model Database, HuggingFace, CivitAI) with calls to these helpers. This centralizes formatting for filename/confidence/size/secondary text and download action rendering, simplifies per-source code (including a top-line model link for CivitAI), and improves readability/consistency without changing user-facing behavior.
2026-04-26 02:14:58 +02:00
Dariusz L c37cee540d Improve CivitAI search and add confidence display
Pass category to CivitAI searches and overhaul civitai source logic: prefer civitai.red tRPC search, extract candidates from tRPC/HTML, add type mapping, richer filename normalization and similarity scoring, per-version file matching, and confidence thresholds; use caching and fallbacks when needed. Also update web UI to display match confidence and file size. These changes aim to produce more accurate model/file matches and surface confidence to users.
2026-04-26 01:58:26 +02:00
Dariusz L 93e79cd17a Update linker.js 2026-04-25 02:47:06 +02:00
Dariusz L 381b327791 Update linker.js 2026-04-25 02:41:23 +02:00
Dariusz L 391b05949a Add analysis progress reporting & UI polling
Add real-time analysis progress reporting and client-side polling during workflow analysis. __init__.py: import asyncio, track per-analysis progress in self.analysis_progress, pass an update callback to analyze endpoint (using asyncio.to_thread), set progress states on success/error, and expose a new GET /model_linker/analyze-progress/{analysis_id} endpoint. core/linker.py: add optional progress_callback parameter to analyze_and_find_matches and emit staged progress updates (extracting, scanning, analyzing, identifying, matching, per-model progress and completed). web/linker.js: introduce analysis progress UI rendering, polling loop (pollAnalysisProgress) keyed by an analysis token, send analysis_id with analyze request, show progress bar/message, and replace search-source buttons with a compact select picker. These changes improve UX by providing live feedback during potentially long analysis runs.
2026-04-25 02:38:37 +02:00
Dariusz L ff75374574 Update linker.js 2026-04-25 02:25:56 +02:00
Dariusz L 888a07ab96 Refine LinkerManagerDialog styles and paddings
Adjust visual styling and spacing in LinkerManagerDialog: remove the hard .ml-card:hover background, add subtle themed styles for download and footer buttons (hover and default states), soften .ml-tab hover colors/gradient, and reduce padding in several header/content areas for a more compact layout. Also set a dialog background variable (--ml-bg) for the main panel. These tweaks improve visual consistency and hover feedback across the dialog.
2026-04-25 02:13:23 +02:00
Dariusz L 6da04270fb Refine Linker UI spacing and button styles
Tighten up LinkerManagerDialog UI: reduce paddings, margins and gaps across cards, columns, rows and inputs to create a more compact layout. Wrap download controls in a new .ml-download-actions container and introduce compact button variants (.ml-btn-sm, .ml-btn-download-main, .ml-btn-download-side, .ml-btn-link-compact) and adjusted icon-only sizes for consistent button sizing. Minor HTML tweaks to download block and match buttons (added compact class on link buttons). Adjust tab active background and shadowing to use theme variable and softer shadows. Remove the inline CivitAI API-key note and add a subtle header bottom border.
2026-04-25 01:45:20 +02:00
Dariusz L fa05f04ae3 Revamp Linker UI styles and title layout
Overhauled the LinkerManagerDialog appearance and title rendering. Introduces new CSS variables (darker background, surface elevation, text-soft, refined accents), updates spacing, radii, shadows, fonts and component styles (cards, chips, badges, buttons, tabs, match rows, combo inputs and footer). Restructures card title HTML into meta/eyebrow/primary/secondary elements and improves URN resolution UX by showing a "Resolving CivitAI model..." placeholder and updating the async resolver output to use a classed link and smarter label fallback. Overall changes improve visual consistency, readability and UX for resolved/unresolved URNs.
2026-04-25 01:34:40 +02:00
Dariusz L 6d1ecf40e5 Refactor linker UI styles and controls
Major UI refactor for the LinkerManagerDialog: replace dark gradients with translucent theme variables, unify card/match/button styling using transparent borders and inset shadows, and add new utility/button variants (ml-btn-utility, ml-btn-icon-only). Replace manual confidence badge markup with getConfidenceBadge and add getStatusBadge helper. Convert the Locate button into a clickable locatable node chip with icon/title, change combo refresh button to an icon-only control, and update the "other matches" entry to use an inline action class. Small layout/interaction tweaks include hover transforms, adjusted paddings/radii, divider variable, and presenting "Not needed" download state when a perfect local match exists. These changes improve visual consistency, compactness, and UX for locating and selecting matches.
2026-04-25 01:14:58 +02:00
Dariusz L 6e282d65b0 Refine LinkerManager UI styles and ghost buttons
Adjust visual styling in web/linker.js to create a more compact, consistent UI. Reduces paddings, margins, gaps and font sizes across cards, rows, tabs and controls; tweaks border radii, shadows and combo/list dimensions. Introduces a new .ml-btn-ghost variant (and applies it to Link/Locate/Refresh buttons) for a subtle button appearance, and updates confidence badge colors/borders for clearer visual hierarchy. Overall changes aim to tighten spacing and harmonize button/badge styling for improved readability and consistency.
2026-04-25 00:23:54 +02:00
Dariusz L 2242412b87 Improve model info UI and sanitize descriptions
Enhance the LinkerManager dialog UI and add safe HTML handling for model descriptions. This adds tooltip '?' helpers with explanatory titles for multiple info rows, wraps descriptions with a collapsible "Show more" widget, and implements sanitizeDescriptionHtml to allow a safe subset of tags/styles/links (and enforce target/rel for external links). Styling updates polish tabs, footer buttons and the description area, remove inline button sizing, and introduce a tab content animation. Also adjust click handling for description toggle and trained-words copy behavior and standardize footer button classes.
2026-04-25 00:18:54 +02:00
Dariusz L 574eba94f5 Improve model info dialog (trained words, images, resize)
Enhance the model info dialog UI and behavior: add selectable trained-words with copy button, normalize/escape/truncate helpers, and persist dialog size using ResizeObserver/localStorage. Update image rendering to safer escaped URLs and richer captions, improve layout and responsive styles, allow resizing with min dimensions, and clean up observers/timers on close. Also bind interaction handlers once per dialog and update summary/count state for selected words.
2026-04-24 23:52:17 +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 2b177817f4 Add subfolder UI, civitai metadata, and path logic
Include base_model and tags in civitai search/resolve results and model lookup responses. Add a new /model_linker/subfolders API route that uses ComfyUI folder_paths to return known subfolder paths for a given category. Improve downloader.get_download_directory to choose a preferred path (preferring paths outside the ComfyUI install) and add robust path normalization/commonpath checks. On the frontend, add download target controls (folder + optional subfolder) with styling, loading of download directories/subfolders, autocomplete and selection logic, heuristics to suggest civitai subfolders (particularly for loras), and integrate the chosen category/subfolder into the download payload and UI wiring.
2026-04-24 22:52:18 +02:00
Dariusz L 068c6885bf Normalize model data for context menus
Add buildContextMenuModelData to LinkerManagerDialog to normalize/resolve model fields (name, original_path, resolved_path, category) and derive a safe filename fallback. Use this helper when serializing match.model for context menu data in renderLocalMatchesContent and the alternative matches loop, ensuring consistent context payloads and avoiding missing/undefined fields when opening the context menu.
2026-04-24 21:47:15 +02:00
Dariusz L 5323ee91da Add local match search and open-folder features
Expose local model matching and folder-opening functionality. Adds search_local_matches to core/linker.py to run local filename/path similarity matching with deduplication and category prioritization. Registers two new HTTP endpoints in __init__.py: /model_linker/local-matches (POST) to search local files and /model_linker/open-containing-folder (POST) to open the OS file explorer at a model's path. Updates web/linker.js to add context-menu item, UI rendering and wiring for local matches (including confidence filtering, expandable alternatives, and button handlers), client-side openContainingFolder call, and triggers to refresh URN local matches. Also surfaces civitai version_name in model results. These changes enable searching and linking local model files from the UI and opening their containing folders.
2026-04-24 21:42:29 +02:00
Dariusz L ca233f6a99 Add Options tab for storing API tokens
Introduce an Options tab and UI for storing CivitAI and HuggingFace API tokens locally. Adds styling, a displayOptions() panel with save/clear actions, getStoredTokens() helper, and integrates token persistence via localStorage. The tokens are now included in download requests (hf_token and civitai_key) so gated downloads can authenticate. Also updates tab switching and related UI visibility to accommodate the new tab.
2026-04-24 20:51:52 +02:00
Dariusz L b64597fd3f Add CivitAI URN download UI and metadata
Move direct URN->CivitAI download handling into the frontend and enrich backend metadata. Removed server-side immediate URN download exposure and adjusted comment numbering. Backend now selects a primary file from resolved CivitAI model info, includes model_id, version_id, size, and a modelVersionId query on model URLs.

Frontend: add renderDownloadSourceSection to render download buttons and CivitAI model-card links, display file sizes, and format names. Store missingModels for later updates; render a placeholder URN download section while resolving; when URN resolution returns, inject civitai info into the missing entry, build a download_source object, replace the placeholder with the rendered download UI, and attach the download button handler. Improved error handling and model URL construction to include modelVersionId when available.
2026-04-24 20:38:11 +02:00
Dariusz L 53f52518ff Revamp model linker UI styles and markup
Overhaul the Model Linker dialog styling and related markup. Introduces a new dark theme palette, gradients, shadows, and consistent radii via CSS variables; replaces many inline styles with reusable classes (ml-missing-summary, ml-card, ml-card-header, ml-card-title, ml-card-subtitle, ml-card-actions, ml-combo-*, ml-search-source-bar, ml-search-results, etc.). Improves card layout, badges, chips, buttons, combo (autocomplete) dropdown UI, download/search panels, and responsive behavior. Also updates HTML generation and a few JS hooks (e.g. scoped selector for search source buttons, combo list markup and IDs, search-results container, selected-bar styling) to match the new classes. Purpose: improve visual clarity, consistency, responsiveness and maintainability of the linker UI.
2026-04-24 19:37:35 +02:00
Dariusz L c8272a8a45 Add source-filtered search and URN CivitAI support
Backend: add explicit URN handling to resolve CivitAI model/version into a direct download source; normalize and accept a `sources` parameter (local, huggingface, civitai, all) and drive per-source searching. Reorder and tighten search logic (local/popular, model-list, HuggingFace, CivitAI) and include `searched_sources` in results and improved logging. Frontend: add per-missing-item search result cache and state, UI buttons to pick search sources, merge incremental results instead of overwriting, show selected-source helper text, pass selected source to the server, clear cache on refresh, and improve search status messages and UX. Overall: enables targeted online searches, preserves previous results, and surfaces direct CivitAI downloads for URNs.
2026-04-24 19:27:53 +02:00
Dariusz L 4fef6c66d9 Defer CivitAI lookups; add async URN resolution
Stop performing automatic online searches during scanning and matching: HuggingFace/CivitAI lookups are no longer done synchronously for each missing file. Core linker now marks URN entries for async resolution instead of calling CivitAI during scan, avoiding blocking network calls and reducing noise. Server-side /model_linker/search remains the on-demand endpoint; __init__.py adds resolve_urn import and tightens validation for URN requests (require model_id+version_id for URN-only requests). Frontend (web/linker.js) updated to show a loading indicator for URN entries and to fetch CivitAI info asynchronously via a new resolveUrnAsync() routine, then update the UI when results arrive. Also includes minor formatting/import grouping and UI label tweaks.
2026-04-23 05:02:08 +02:00
Dariusz L 040fa64584 Add CivitAI hash lookup and context menu UI
Enhance model linking with CivitAI integration and UI improvements.

- __init__.py: Expand model path resolution by building filename→path lookup (including no-ext keys) and using folder_paths to map common categories; add a /model_linker/civitai-search POST route that attempts metadata/hash-based lookup (or filename fallback) and returns CivitAI model/version info for the frontend.
- core/sources/civitai.py: Add hashing and metadata handling utilities: _get_sha256_hash, metadata discovery/reading, helpers to extract images/trained-words, get_model_info_by_hash and get_model_info_for_file (which prefers local metadata and otherwise queries CivitAI by hash). Also tidy/normalize existing search/resolve functions and add caching for hash lookups.
- web/linker.js: Add a right-click context menu for model chips with actions (Show Info, Open in CivitAI), implement dialog UI to display model info, and wire calls to the new civitai-search endpoint. Includes positioning/closing behavior and dialog population from returned data.

These changes enable accurate model identification via local metadata or sha256 lookups on CivitAI and provide convenient frontend actions to view model details or open CivitAI pages.
2026-04-21 20:35:10 +02:00
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