Commit Graph
92 Commits
Author SHA1 Message Date
Dariusz L bebf5b6e59 web: refine Model Linker UI — improve context menu, tooltips, info dialog, and styles
Improve UX for model relinking: add context menu actions (Show Info, Open on CivitAI, Open containing folder), sanitize CivitAI descriptions, persist info dialog size, and adjust CSS spacing and visibility.
2026-05-26 15:52:05 +02:00
Dariusz L b4798333d6 web/log_system: bump version to 1.5.5 and improve logger output\n\n- Bump package version to 1.5.5\n- Include configurable milliseconds in timestamps and compact callsite labels\n- Improve console output formatting and grouping of expanded details\n- Parse and print structured JSON payloads in string args\n- Normalize and enrich callsite information for clearer source labels\n- Misc refactors and bugfixes to formatting and suffix logic\n\nReason: improve developer console readability and make logs easier to inspect and parse. 2026-05-26 14:58:11 +02:00
Dariusz L 7d8c8895f1 docs(linker): clarify 32 UI tooltips, labels, and button titles for better usability
Improve text on buttons, info-panel rows, settings tooltips, and menu
labels to more accurately describe what each element does rather than
stating the obvious. No functional changes.
2026-05-20 03:21:04 +02:00
Dariusz L 272033acfe refactor(log_system): bump web logging system to v1.5.3
- Update version field in config.js, log_funcs.js, and logger.js from 1.5.1 to 1.5.3
- Rename LoggerUtils to lowercase_kebab-case log_funcs in log_funcs.js description
- Simplify Logger description to lowercase logger in logger.js
- Remove 'Colorful logs in the console' detail from logger.js description
2026-05-20 01:51:27 +02:00
Dariusz L cb106e5d73 feat(log_system): add call site tracking to web Logger
Capture and display the file path, line, and column where each log
call originated. Uses a lightweight stack-trace parser (Error().stack)
that skips internal log_system frames, preferring the first external
caller.

Changes:
- getCallsite(), parseStackLine(), formatCallsite(), formatSuffix() added
- log() and logModule() include callsite in logData and display it as
  a parenthetical suffix on both console and exported output
- serializeLogEntry/logToStorage/logToInspector preserve callsite through
  serialization round-trips
- exportLogs text output uses formatSuffix for consistent display
2026-05-20 01:46:55 +02:00
Dariusz L de9819e2b9 fix(log_system): bump web version to 1.5.1; fix inspector spacing and parseLoggerDetail edge case
- Bump web/log_system version from 1.5.0 to 1.5.1 to match core/
- Fix console inspector format: add space before suffix %c and trailing empty
  color intent so suffix text is not merged with the preceding styled message
- Add edge case guard in splitModuleName for single-part module strings that
  differ from LOGGER_NAME, restoring previous behavior of returning the
  logger name as root and the full value as detail
2026-05-20 00:24:53 +02:00
Dariusz L 72d084ab64 refactor: rename utils to lowercase_kebab-case and fix import paths; add Missing Models popup integration to linker
- Rename web/utils/{css-loader→css_loader,ErrorHandler→error_handler,IconUtils→icon_utils,ResourceManager→resource_manager} and web/log_system/{LoggerUtils→log_funcs} to lowercase_kebab-case naming convention
- Update all cross-import paths in the recreated utils and linker.js accordingly
- Add removeResolvedFromPopup / markEntryAsResolved to visually mark resolved entries in the ComfyUI Missing Models popup
- Add updateNodesDirectly to update graph node widgets in-place without triggering a full workflow reload
- Add checkAndOpenForMissingModels with isAutoOpenEnabled/setAutoOpenEnabled to auto-open the linker dialog when a workflow with missing models is loaded
- Add helper methods getMissingSearchKey, getSearchState, mergeSearchResults for per-entry search state caching and merging
2026-05-19 07:55:28 +02:00
Dariusz L e6389366d4 feat(log_system): bump version to 1.5.0 and restructure LoggerUtils JSDoc
- Bump package version from 1.4.1 to 1.5.0 across LoggerUtils.js, config.js, and logger.js
- Move changelog-style feature notes inline under the author/version JSDoc header
  in LoggerUtils.js, replacing the trailing block comment with a structured list
2026-05-19 07:44:31 +02:00
Dariusz L b532d83ae7 feat(log_system): restructure console log output with color-coded table format and module name splitting
- Rename LOG_MODULE_NAME from 'model-linker' to 'MLinker' for shorter prefixes
- Add USE_COLORS config option to control styled console output
- Refine log level color palette: purple/debug, green/info, amber/warn, red/error
- Update timestamp format to HH:mm:ss.SSS for millisecond precision
- Refactor console log rendering to a color-coded table layout with background
  highlights on timestamps and logger name columns
- Add splitModuleName helper to separate root module from dotted sub-namespace
- Add stringifyArgs helper for safe serialization of non-string log arguments
  (strings, errors, objects via JSON.stringify, fallback to String)
- Update serializeLogEntry and console output to use the new leveled layout
  (levelName padded to fixed width)
2026-05-19 07:40:47 +02:00
Dariusz L 9721fdbd0a refactor(web): extract renderSearchControls method and expose search UI alongside download source
Move the inline search-control HTML block into a dedicated renderSearchControls()
method on LinkerManagerDialog so the search bar can be reused from multiple code paths.

Previously, the search controls were only rendered when no download source was known.
Now they are also shown when a download URL exists, giving users the ability to run a
search alongside the resolved download source.

Also normalises line endings on one affected line.
2026-05-17 05:31:06 +02:00
Dariusz L ffb97fb957 docs: clarify HuggingFace token requirements in settings tooltip
Update the HuggingFace Token tooltip to provide precise guidance on
creating a fine-grained token with only Read access to public gated
repos, explicitly noting that Write, Inference, Webhooks, Billing,
Jobs, and org permissions are not needed.
2026-05-17 05:08:29 +02:00
Dariusz L 94abcdc05f feat: add latent_upscale_models category support and improve workflow model resolution
- core/downloader.py: add latent_upscale_model(s) download directory mappings
- core/workflow_analyzer.py:
  - add node type hints for VAELoaderKJ, LatentUpscaleModelLoader, DualCLIPLoader
  - introduce MODEL_WIDGET_NAME_TO_CATEGORY and get_widget_category_hint() to
    infer model categories from widget/input metadata (best-effort fallback)
  - extend NESTED_MODEL_KEYS with clip_name / clip_name1 / clip_name2
  - apply widget category hint inside get_node_model_info() for both plain
    filenames and URN-style references, matching resolution and error paths
- web/linker.js:
  - add getCategoryDisplayName() and getCategoryTokenName() helpers (including
    latent_upscale_model entries) replacing duplicated inline maps
  - use helpers for download target category chips, model-group tokens, and
    summary/compact clipboard strings
2026-05-17 04:21:59 +02:00
Dariusz L eccf6e9d1e refactor: overhaul logging system across backend and web frontend
- Switch __init__.py to use create_module_logger(); remove inline logging.getLogger calls
- Rewrite log_funcs.py: introduce module-name normalization (_normalize_module_name/_normalize_module_path/_resolve_module_name), ModuleLogger class, and global log-level switching (set_global_level replaces per-module set_module_level)
- Enhance logger.py: show [name:lineno] in console prefix, sanitize log file names for safe filesystem paths, wrap RotatingFileHandler setup with OSError handling to fall back to console-only logging, pass stacklevel through log() and propagate kwargs to exception()
- Update web/log_system/logger.js: dispatch to level-specific console methods (debug/info/warn/error) via CONSOLE_METHODS map; replace truncated t/m/l/a localStorage schema with serializeLogEntry/deserializeLogEntry (backward-compatible with short keys); load saved logs on construction via loadLogs()
2026-05-17 03:38:23 +02:00
Dariusz L 967afb609c fix: correct CSS escaping for Flux model tags and remove invalid vertical-align
- Escape dot in .1 class names (Flux.1, Flux.1-d) to valid CSS syntax
- Remove vertical-align: top from block-level input/select elements
2026-05-11 05:34:14 +02:00
Dariusz L e5fa58f262 UI modernization: centralize SVG icons and adopt CSS variables
- Create web/utils/IconUtils.js with centralized SVG icon definitions
- Replace inline SVGs in linker.js with getSvgIcon() calls
- Refactor CSS to use CSS custom properties throughout
- Add renderProgressWithAction() helper for consistent progress UI
- Add renderOnlineSearchResultCard() helper for search results
- Add MLToggleHidden() utility for show/hide toggle
- Replace hardcoded spacing, fonts, colors with CSS variables
- Standardize markup with reusable CSS classes
2026-05-11 05:09:24 +02:00
Dariusz L ac4ba4df42 refactor(css): extract inline styles to dedicated CSS files
Remove ~8000 lines of inline JavaScript styles from linker.js and organize
them into two focused stylesheets:
- linker-shell.css: modal shell, backdrop, window controls, layout structure
- linker-main.css: main content area (cards, buttons, forms, dialogs, tabs)

Simplify and clean up css-variables.css variable definitions.
Update css-loader.js to load both new stylesheet files.

Significantly improves code maintainability and separation of concerns.
2026-05-11 04:52:58 +02:00
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 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