ComfyUI Extension: comfyui-model-linker-desktop
A ComfyUI extension that helps users relink missing models in workflows
Custom Nodes (0)
README
ComfyUI Model Linker - Desktop Edition
Version 2.2.0 | December 16, 2025
A ComfyUI Desktop-compatible fork that automatically detects missing models in workflows and helps you relink them with intelligent fuzzy matching, plus integrated model downloads!
Based on the work of:
- @kianxyzw - Original Model Linker ā
- @gontz - Improved Fork ā
https://github.com/user-attachments/assets/c81ab111-692d-47cd-87c2-687b0c8659a8
What's New in This Desktop Edition?
This fork adds ComfyUI Desktop compatibility with major enhancements:
Latest Updates (December 16, 2025) - v2.2.0
Download & Installation Features š
- ā¬ļø Integrated Model Downloads: Download missing models directly from URLs with progress tracking
- š Real-Time Progress Bars: Visual progress with percentage, MB downloaded/total, and speed
- ā Cancel Downloads: Stop downloads mid-transfer with instant cleanup
- š Partial File Protection: Downloads to
.tmpfiles first - prevents corrupted models in library - š Search Integration: Quick search buttons for CivitAI and HuggingFace
Matching & Selection
- šÆ Smart Multi-Option Selection: 90-99% confidence matches show 2-3 options with individual resolve buttons
- š» Radio Button Selection: 70-89% confidence matches let you pick the correct model manually
- š§ Intelligent Token-Based Matching: Version-aware algorithm (e.g.,
wan2.1vswan2.2are now distinct!) - š Critical Bug Fix: Fixed false 100% matches caused by version numbers being treated as file extensions
- ā Improved Accuracy: Correct matches now score 87-94% vs wrong matches at 43-49%
Core Features
- ā Desktop App Support: Works seamlessly in ComfyUI Desktop's Electron environment
- šÆ Draggable Button: Movable UI button with position persistence
- š§ Fixed API Routing: Proper URL handling for Desktop's architecture
- š¾ Position Memory: Button position saves across sessions
- š Enhanced Logging: Better debugging support for Desktop environment
- š¾ Model Cache System: Caches model locations for faster lookups and cross-drive discovery
- š Custom Directory Support: Add your own directories to scan via config file
Features
Model Matching & Resolution
- š Automatic Detection: Scans workflows and identifies all missing models
- š§ Smart Token-Based Matching: Version-aware fuzzy matching that understands model names (e.g., distinguishes
wan2.1fromwan2.2) - šÆ 4-Tier Confidence System: Intelligent handling based on match quality
- š¢ 100% Perfect Matches: Auto-resolvable with one click
- š” 90-99% High Confidence: Shows 2-3 options, click to resolve your choice
- āŖ 70-89% Medium Confidence: Radio button selection for manual verification
- ā < 70% No Good Match: Search and download options
- š Flexible Resolution: One-click resolve or manual selection based on confidence
- ā” Batch Auto-Resolve: Automatically resolve all 100% confidence matches at once
Download & Installation š
- ā¬ļø Direct Model Downloads: Download missing models from any URL
- š Progress Tracking: Real-time progress bars showing percentage, speed, and MB transferred
- ā Cancellable Downloads: Stop downloads anytime with instant cleanup
- š Safe Downloads: Uses
.tmpfiles to prevent corrupted models in library - šÆ Auto-Installation: Downloads place models in correct ComfyUI directories automatically
- š Quick Search: One-click search on CivitAI and HuggingFace
User Interface
- šØ Draggable UI: Movable button that remembers its position
- š¾ Position Memory: Button position persists across sessions
- šļø Intuitive Controls: Color-coded confidence levels and clear action buttons
Installation
For ComfyUI Desktop
-
Navigate to your ComfyUI custom nodes directory:
C:\ComfyUIData\custom_nodes\ -
Clone this repository:
cd C:\ComfyUIData\custom_nodes git clone https://github.com/rethink-studios/comfyui-model-linker.git -
Restart ComfyUI Desktop
-
You should see a draggable "š Model Linker" button in the top-right corner
Updating to Latest Version
Quick Update (Windows):
- Double-click
UPDATE.batin the Model Linker folder - Wait for the update to complete
- Restart ComfyUI Desktop
Manual Update:
cd C:\ComfyUIData\custom_nodes\comfyui-model-linker
git pull origin main
For Standard ComfyUI
-
Navigate to your ComfyUI custom nodes directory:
ComfyUI/custom_nodes/ -
Clone this repository:
cd ComfyUI/custom_nodes git clone https://github.com/rethink-studios/comfyui-model-linker.git -
Restart ComfyUI
Usage
Basic Workflow
-
Open Model Linker: Click the "š Model Linker" button in the UI
-
Review Missing Models: The dialog shows all missing models organized by confidence level:
š¢ 100% Perfect Matches (Green)
- Exact filename matches after normalization
- Will be auto-resolved when you click "Auto-Resolve 100% Matches"
š” 90-99% High Confidence (Orange)
- Shows 2-3 best matching options
- Each option has its own "Resolve" button
- Click "Resolve" on the correct model
- Great for minor filename variations (e.g.,
model_v1vsmodel-v1)
āŖ 70-89% Medium Confidence (Gray)
- Shows 2-3 possible matches with radio buttons
- Select the correct model using radio buttons
- Click "Resolve Selected" to apply your choice
- Manual verification recommended
ā < 70% No Good Match (Red) š
- Shows search buttons for CivitAI and HuggingFace
- Paste a download URL in the input field
- Click "Download" to start downloading
- Watch real-time progress bar with cancel option
- Model auto-installs when complete
-
Resolve Your Choices:
- For 90-99%: Click "Resolve" on the correct option
- For 70-89%: Select with radio button, then click "Resolve Selected"
- For < 70%: Search, paste URL, and download
-
Auto-Resolve Perfect Matches: Click "Auto-Resolve 100% Matches" to fix all perfect matches at once
Download Workflow (For Missing Models)
- Find the Model: Click "Search CivitAI" or "Search HuggingFace" to open search in new tab
- Get Download URL: Copy the direct download link from the model page
- Paste URL: Paste the URL in the input field
- Start Download: Click the "Download" button
- Monitor Progress: Watch the progress bar (percentage and MB)
- Cancel Anytime: Click "Cancel" button to stop download if needed
- Auto-Install: Model automatically places in correct directory when complete
- Verify: Model Linker refreshes and shows the model as resolved
Safety Note: Downloads use temporary .tmp files during transfer, so cancelled or failed downloads never corrupt your model library!
Dragging the Button
- Click and hold the button to drag it to your preferred position
- Position is automatically saved and persists across sessions
- Quick click (without dragging) opens the Model Linker dialog
How It Works
Detection
The Model Linker scans your workflow and identifies:
- Checkpoints
- LoRAs
- VAEs
- ControlNet models
- Text encoders
- And more...
Fuzzy Matching
Uses token-based intelligent matching to find similar models:
- Exact filename matches (100% confidence)
- Version number awareness: Distinguishes
2.1from2.2,v1fromv2 - Token-based comparison: Breaks filenames into meaningful components
- Weighted scoring: 70% token similarity + 30% character similarity
- Normalized comparisons: Handles
_,-,.variations (e.g.,model_name=model-name) - Category-aware searching: Only searches appropriate model types
Example:
Target: wan2.1_t2v_14B_fp8_scaled.safetensors
ā Wrong: wan2.2_fun_control_high_noise... ā 49% (different version!)
ā
Correct: Wan2_1-T2V-14B_fp8_e4m3fn... ā 87% (same version & key tokens)
Resolution
When you resolve a model:
- The workflow is updated with the correct model path
- The UI immediately reflects the change
- The updated workflow is ready to run
Configuration
Custom Directories & Cache
Model Linker supports custom directories and a cache system for better model discovery:
Adding Custom Directories
-
Copy
model_linker_config.yaml.exampletomodel_linker_config.yamlin:- Your ComfyUI user directory (recommended), OR
- The Model Linker directory (
C:\ComfyUIData\custom_nodes\comfyui-model-linker\)
-
Edit
model_linker_config.yamland add your directories:
additional_directories:
- "D:\MyModels\Checkpoints" # External drive
- "\\\\server\models" # Network drive
- "C:\CustomModels" # Local directory
- Restart ComfyUI Desktop
Model Cache System
Model Linker automatically caches model locations for:
- ā” Faster lookups - No need to rescan every time
- š Cross-drive discovery - Finds models even if drives are temporarily unavailable
- š¾ Persistent storage - Cache survives restarts
Cache Location: [ComfyUI User Directory]/model_linker_cache.json
Cache Settings (in model_linker_config.yaml):
cache:
enabled: true # Enable/disable cache
auto_refresh: true # Refresh on startup
refresh_interval_hours: 24 # Auto-refresh every 24 hours (0 = every startup)
Manual Cache Refresh:
- Use the API endpoint:
POST /model_linker/cache/refresh - Or restart ComfyUI (if
auto_refresh: true)
Model Paths
Model Linker automatically scans all configured model directories in ComfyUI. To add additional directories via ComfyUI's config:
- Edit your
extra_model_paths.yamlfile - Add your custom model directories
- Restart ComfyUI
Example:
your_models:
base_path: C:\ComfyUI\models
checkpoints: checkpoints
loras: loras
vae: vae
Note: Model Linker will automatically find and use extra_model_paths.yaml - no hardcoded paths!
Troubleshooting
Button Not Showing
- Check the browser console (Ctrl+Shift+I) for errors
- Ensure the extension loaded: Look for "Model Linker: API routes registered successfully!"
- Try clearing browser cache and restarting ComfyUI
Models Not Found
- Verify your model directories are configured in
extra_model_paths.yaml - Check that models are in the correct category folders
- Ensure ComfyUI can access the directories (permissions)
Resolution Not Working
- Open the browser console (Ctrl+Shift+I) to see detailed logs
- Check for "Updated X model paths in workflow" message
- Verify the workflow format is compatible (Graph or API format)
Download Issues š
Download Won't Start:
- Verify the URL is a direct download link (not a webpage)
- Check browser console (Ctrl+Shift+I) for errors
- Ensure you have write permissions to model directories
Cancelled Download Still Shows as Missing:
ā
This is correct! Cancelled downloads are cleaned up (.tmp files deleted) to prevent corrupted models.
Download Stuck/Slow:
- Check your internet connection
- Try cancelling and restarting the download
- Some hosts may rate-limit downloads
Model Not Appearing After Download:
- Wait for "Download complete" alert
- Check the browser console for the installation path
- Verify the model was placed in the correct category folder
- Try clicking "Reload" in Model Linker dialog
Development
Project Structure
comfyui-model-linker/
āāā __init__.py # Extension entry point
āāā core/ # Python backend
ā āāā __init__.py
ā āāā linker.py # Main linking logic
ā āāā matcher.py # Fuzzy matching algorithms
ā āāā scanner.py # Model directory scanning
ā āāā workflow_analyzer.py # Workflow parsing
ā āāā workflow_updater.py # Workflow modification
āāā web/ # JavaScript frontend
āāā linker.js # UI and client logic
API Endpoints
Model Matching & Resolution:
POST /model_linker/analyze- Analyze workflow for missing modelsPOST /model_linker/resolve- Apply model resolutionsGET /model_linker/models- List all available models (uses cache by default)- Query param:
?use_cache=falseto force fresh scan
- Query param:
GET /model_linker/health- Health checkPOST /model_linker/cache/refresh- Force refresh model cache
Download Functionality: š
POST /model_linker/download- Start model downloadGET /model_linker/download/{id}/progress- Get download progressPOST /model_linker/download/{id}/cancel- Cancel active download
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
Credits
This project builds upon excellent work by:
-
@kianxyzw - Original Model Linker
Created the original ComfyUI Model Linker with fuzzy matching -
@gontz - Enhanced Fork
Improved the original with additional features and refinements -
RETHINK Studios - Desktop Edition
Adapted for ComfyUI Desktop with draggable UI and bug fixes
Special thanks to both original authors for creating this excellent tool! š
Support
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the troubleshooting section above
- Enable debug logging in the browser console
ā If you find this useful, please star the repository!