Commit Graph
106 Commits
Author SHA1 Message Date
Dariusz L 29ffaea809 Update config.js 2026-05-11 02:52:06 +02:00
Dariusz L 61f5898be9 Translate to English 2026-05-11 02:51:59 +02:00
Dariusz L 995b897f95 refactor(css): consolidate CSS loading to single variables file
Remove individual CSS component file references and streamline css-loader
to only load css-variables.css. The web/css directory now contains the
consolidated stylesheet, reducing complexity and improving maintainability.
2026-05-11 02:47:18 +02:00
Dariusz L 79412da9b8 Translate to English 2026-05-11 02:44:30 +02:00
Dariusz L a288b26b66 refactor(logging): AzLogs v1.4.1 with dynamic storage and utilities
Enhance logging system with configurable module names and dynamic
localStorage keys to avoid conflicts between multiple plugin instances.

- Add LOG_MODULE_NAME and DEFAULT_LOGGER_NAME to web/log_system/config.js
- Update logger.js to use dynamic storage keys based on module name
- Change window property from ResolutionMasterLogger to dynamic key
- Add PyDoc metadata to core/log_system/config.py
- Add JSDoc metadata blocks to all web log_system files

Reorganize web utilities:
- Move css-loader.js from web/ to web/utils/
- Add ErrorHandler.js for centralized error handling
- Add ResourceManager.js for stylesheet and template loading

 rename: web/css-loader.js => web/utils/css-loader.js
2026-05-11 02:41:30 +02:00
Dariusz L bd7e40209f Translate to English 2026-05-11 02:19:43 +02:00
Dariusz L 79b1bef93e Add centralized logging system with CSS loader
- Implement core logger (logger.js) with log levels (DEBUG/INFO/WARN/ERROR)
- Add LoggerUtils.js for module-specific logger initialization
- Add configuration module (config.js) with DEBUG level default
- Add CSS loader for dynamic stylesheet loading
- Features: color-coded console output, localStorage persistence, log export, per-module log level control
2026-05-11 02:17:25 +02:00
Dariusz L 60b300f43e Add node title tracking and display for workflow models
- Add 'node_title' field to model info dictionaries in get_node_model_info
- Display custom node titles in missing models dialog when available
- Show 'NodeLabel #id · CustomTitle' format for better model identification
2026-05-10 17:28:33 +02:00
Dariusz L b118c03be1 refactor(linker): improve _locateNode zoom/pan calculation
- Split scale into startScale and targetScale for clarity
- Introduce padding constants (140px horizontal, 96px vertical)
- Calculate fitScale based on viewport and node dimensions with padding
- Constrain target scale between 0.15 and 1 minimum/max bounds
- Extract getCenteredOffset helper for offset calculations
- Simplify animation interpolation using consistent offset objects
2026-05-10 06:42:19 +02:00
Dariusz L 25760bb7d8 feat(ui): add animated canvas panning when locating nodes
Replace instant canvas jumps with smooth animated transitions using
ease-in-out-cubic easing. The animateCanvasToNode method calculates the
target offset based on node position and canvas dimensions, then smoothly
interpolates the canvas offset over 380ms. Includes proper cleanup of
pending animation frames and fallback handling for older ComfyUI versions.
2026-05-10 06:35:52 +02:00
Dariusz L 9783a1641d refactor(ui): remove backdrop click-to-close, replace locate icon with SVG
- Remove backdrop click event listener that closed the dialog
- Change backdrop background from rgba(0,0,0,0.5) to transparent
- Hide backdrop entirely in show() method (display: none)
- Replace text-based locate icon (⌖) with SVG icon via getLocateIconHtml()
- Add CSS styling for .ml-node-chip-icon and its SVG element
2026-05-10 06:31:00 +02:00
Dariusz L ba6ee57245 fix: improve download target UI layout and styling
- Restructure DOM order: label + select (folder) first, then label + input (subfolder)
- Add grid-template-rows for proper vertical alignment
- Remove min-height constraint on labels for better responsiveness
- Set explicit height (40px) and margin on select/input fields
- Add appearance:none reset to select for consistent cross-browser styling
- Wrap subfolder input in flex container for alignment
- Add mobile-breakpoint rule to reset label min-height
2026-05-10 06:22:30 +02:00
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 5fc838ba4b Update model-aliases.json 2026-04-27 13:33:53 +02:00
Dariusz L 927c7898e1 Update requirements.txt 2026-04-27 13:16:57 +02:00
Dariusz L 4e7cad6253 Delete pyproject.toml 2026-04-27 13:15:49 +02:00
Dariusz L 114e5b51bf Create LICENSE 2026-04-27 13:14:18 +02:00
Dariusz L 2d2a322843 Remove old files 2026-04-27 13:11:05 +02:00
Dariusz L 226f69da96 Update README.md 2026-04-27 13:01:17 +02:00
Dariusz L 4756831e21 Update README.md 2026-04-27 13:00:25 +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 1fc404ebfd Add detailed logging to model linker and sources
Add extensive observability/logging across ModelLinker and source search modules. __init__.py: introduce summarize_result and log_search_result helpers, replace ad-hoc logger calls with log_info/log_exception, and add start/result/summary logs for local, popular, model_list, HuggingFace and CivitAI searches (including extra metadata like confidence, files_count, results_count). core/sources/civitai.py: log cache hits, API call start, response counts, model/version/file checks, no-result info and improved exception logging. core/sources/huggingface.py: log cache hits, API call start, response counts, per-repo debug info, repo tree sizes, no-result info and improved exception logging. Changes are focused on diagnostics and do not alter core search logic.
2026-04-25 23:43:17 +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