Commit Graph
131 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 538d5ed50a Refactor source search into async per-source tasks
Extract local, HuggingFace, CivitAI and lora-manager searches into functions returning (results, found); build search_tasks and run them concurrently with asyncio.to_thread + asyncio.gather; consolidate result merging. Improves concurrency and clarity.
2026-05-26 15:27:15 +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 ca5de099b0 Add include_brackets option to ColoredFormatter
Adds a new include_brackets parameter to ColoredFormatter that controls
whether square brackets wrap timestamps, root labels, and log level names
in formatted log output. When True, brackets are applied; when False
(the default for AzLogsLogger), brackets are omitted for cleaner output.
This allows callers like AzLogsLogger to opt-in to bracket formatting
independently via the constructor.
2026-05-20 02:10:20 +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 780ef9d0ef refactor(log_system): bump to v1.5.2 — bracket-wrapped console output, shared file handlers, and milliseconds toggle
Console output (ColoredFormatter):
- Level name is now wrapped in [LEVEL] and left-padded via _format_level.
- Timestamp and root-label segments are individually bracket-wrapped, keeping
  plain-output layout consistent with coloured output.
- Separator between fields is colourised (colour code derived from level theme)
  so the table structure remains readable.
- New include_milliseconds init flag controls whether a fractional-second suffix
  is appended to the timestamp; _format_time respects it.
- _display_logger_name unchanged; _split_logger_name still decomposes dotted names
  into root / detail parts.

File logging (AzLogsLogger):
- file_handlers dict introduced to cache one RotatingFileHandler per top-level
  root module, preventing duplicate handlers when multiple sub-modules log to
  the same file (_get_file_handler / _get_log_file / _root_module_name).
- File handler formatter upgraded from a bare logging.Formatter to ColoredFormatter
  (colours off, milliseconds on, datefmt hard-coded to
  '%Y-%m-%d %H:%M:%S') so file output carries the same column structure as
  the console formatter.
- reset_loggers method properly removes and closes all handlers (StreamHandler
  and RotatingFileHandler) from every configured logger before clearing
  self.loggers and self.file_handlers, allowing _get_logger to be called again
  with fresh settings.
- set_file_logging now delegates to reset_loggers instead of simply clearing
  the loggers dict.
2026-05-20 01:34:51 +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 0c7c76b263 refactor(log_system): bump version to 1.5.1; add ruff noqa T201 to log_funcs and logger
- Increment log_system version from 1.5.0 to 1.5.1 in all module docstrings
- Add # ruff: noqa: T201 to log_funcs.py and logger.py to suppress
  ruff T201 (favored print() usage) warning in logging utility modules
2026-05-19 07:59:16 +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 bcd947e37d feat(log_system): add USE_COLORS config option for ANSI console color support
- Bump version to 1.5.0 in config.py, log_funcs.py, and logger.py
- Add USE_COLORS = True to core/log_system/config.py
- Import USE_COLORS in log_funcs.py and pass it to the logger context as
  use_colors, honouring AZLOGS_USE_COLORS env var when set
2026-05-19 07:35:52 +02:00
Dariusz L 5b4d82f26f feat(logger): add colored log level badges, timestamps, and logger name highlighting
- Introduce LEVEL_THEME mapping per-level RGB colors for DEBUG/INFO/WARN/ERROR
- Add TIME_BG background color for timestamp blocks
- Refactor _color_level into _color_level_badge: bold + background color badge
- Add _color_timestamp, _color_root_label, _color_separator, _color_message helpers
- Format output as: <level-badge> <timestamp> <root-label> <message> <source>
- Split logger name into root/detail via _split_logger_name; show only detail in source field
- Non-colored fallback path uses same structured layout without ANSI codes
2026-05-19 07:28:47 +02:00
Dariusz L 367a6d208a refactor(logging): reformat log output, adjust stacklevel and field widths
- Change logging stacklevel from 3 to 4 in all log helper functions
  (create_module_logger, log_debug, log_info, log_warn, log_error) to
  correctly attribute the caller location in stack output.

- Reduce level_field_width from 9 to 5 (e.g. ERROR→5 chars) and set
  source_field_width to 0 so source column auto-sizes to its content.

- Add MESSAGE color (cyan) for log message highlighting in colored output.

- Extract four helper methods from ColoredFormatter.format:
  _display_logger_name  — strips the 'azlogs.' namespace prefix
  _display_level_name   — normalises WARNING → WARN for compact display
  _format_time          — builds HH:MM:SS.mmm timestamps
  _color_level          — applies bold+color to the level token

- Simplify format() to assemble [HH:MM:SS.mmm] LVL (logger:line): message
  with the new helpers applied inline.
2026-05-19 06:44:00 +02:00
Dariusz L 0584dc819f refactor(linker): separate normalized download URL from original workflow URL in link extraction 2026-05-17 06:05:53 +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 34e3d73f3f refactor(logging): add configurable field widths for log level and source
- Set default level/source field widths to 0 (no extra spacing) in DEFAULT_CONFIG
- Add level_field_width and source_field_width parameters to ColoredFormatter
- Pad/center level tag and ljust source tag ([name:lineno]) consistently
- Add _field_width() helper to safely convert config values to non-negative ints
- Pass config widths through to ColoredFormatter in AzLogsLogger setup
- Set LOG_MODULE_NAME to 'MLinker' in config.py
2026-05-17 03:47:24 +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 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