e096f2c786722b702e0ee6500847c2c1b5821c8f
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.
ComfyUI Model Linker Extension
A ComfyUI extension that helps users relink missing models in workflows using fuzzy matching.
https://github.com/user-attachments/assets/fedf3645-aa66-49f7-b01d-8c3b5127faf4
Features
- Scans all nodes in workflows to find missing models
- Uses fuzzy matching to suggest similar model files
- Updates workflow JSON in UI/memory (user saves themselves)
- Supports all node types
- Optional auto-resolve for 100% confidence matches
Installation
- Clone or download this repository
- Place it in your ComfyUI custom_nodes/ directory
- Restart ComfyUI
Usage
- Open a workflow with missing models
- Click the "🔗 — Model Linker" button in ComfyUI's top menu bar
- Review missing models and their suggested matches
- Click "Resolve" for individual models or "Auto-Resolve 100% Matches" for perfect matches
- Save your workflow when ready
Features
- Subgraph Support: Automatically detects and handles missing models inside subgraphs
- Smart Matching: Shows 100% confidence matches when available, otherwise shows best matches (≥70% confidence)
- Fuzzy Matching: Uses intelligent similarity scoring to find model files even with different naming
- Auto-Resolve: One-click resolution for all perfect matches
Languages
JavaScript
47.5%
Python
45.7%
CSS
6.8%
