A ComfyUI custom plugin that scans workflows, detects required models, resolves missing metadata, and installs missing assets directly into the correct ComfyUI model folders.
It is designed to behave like a lightweight model-aware installer for shared workflows, with automatic detection, optional manual candidate resolution, download progress tracking, and plugin self-update support.
- Scan the current ComfyUI workflow for required assets
- Detect assets from:
properties.modelsMarkdownNote/Model Links- inferred loader nodes such as:
CheckpointLoaderSimpleLoraLoaderVAELoaderCLIPLoaderUNETLoaderControlNetLoaderUpscaleModelLoader- and more
- Resolve missing metadata using:
- local resolver cache
- optional
known_models.json - Hugging Face search fallback
- Show candidate matches for ambiguous assets
- Manually choose a candidate from the UI
- Install:
- selected models
- all resolved missing models
- Live per-row download progress:
- total size
- downloaded bytes
- progress bar
- Job log with current file progress:
- example:
Downloading 3 GB of 30 GB (10%)
- example:
- Cancel the current job
- Check for plugin updates
- Update plugin via
git pull origin main
This plugin currently supports:
- automatic workflow scanning
- model metadata extraction
- Hugging Face-based asset resolution
- direct asset installation into the correct ComfyUI folders
- progress monitoring and cancellation
- manual candidate selection for unresolved or ambiguous assets
At the moment, the resolver is focused on Hugging Face plus local cache/catalog matching.
Clone this repository into your ComfyUI custom_nodes folder:
cd ComfyUI/custom_nodes
git clone https://github.com/YOUR_USERNAME/ComfyUI-Model-Installer.gitThen restart ComfyUI.
This plugin expects a working ComfyUI installation and Python environment.
Python dependencies used by the backend include:
requestshuggingface_hub
If needed, install them manually in your ComfyUI Python environment:
pip install requests huggingface_hubIf a workflow node includes structured model metadata, the plugin will use that directly.
Example:
{
"properties": {
"models": [
{
"name": "example_model.safetensors",
"url": "https://huggingface.co/org/repo/resolve/main/example_model.safetensors",
"directory": "checkpoints"
}
]
}
}If the workflow includes a note listing model URLs, the plugin can parse links and infer target directories.
If the workflow does not include full metadata, the plugin can infer missing assets from loader nodes.
Examples:
CheckpointLoaderSimple→checkpointsLoraLoader→lorasVAELoader→vaeCLIPLoader→text_encodersUNETLoader→diffusion_models
These inferred assets are then sent through the resolver pipeline.
When an asset is missing its URL, the plugin tries to resolve it using this order:
- local resolver cache
known_models.json(optional curated catalog)- Hugging Face search
- manual candidate confirmation if needed
Assets can appear as:
resolvedambiguousunresolvedneeds resolutionprovidedresolved_from_cacheresolved_from_catalogresolved_autoresolved_manual
Some Hugging Face models are gated or require authentication before they can be downloaded.
If a model needs access approval, the plugin may show an error like:
Hugging Face authentication required or access not granted for this model.
Set HF_TOKEN or login with 'hf auth login'.
Use this guide to generate an HF_TOKEN: https://huggingface.co/docs/hub/security-tokens
Set your Hugging Face token as an environment variable before starting ComfyUI.
Windows PowerShell
setx HF_TOKEN “hf_your_token_here”
After setting it, restart ComfyUI.
Windows CMD
setx HF_TOKEN hf_your_token_here
After setting it, restart ComfyUI.
Linux / macOS
export HF_TOKEN=“hf_your_token_here”
Then start ComfyUI from the same terminal session.
If you already use the Hugging Face CLI, you can authenticate with:
hf auth login
Then restart ComfyUI.
Important notes
- Your Hugging Face account must already have access to the gated model repository
- Setting a token does not automatically grant access to a gated repo
- If access has not been approved on Hugging Face, downloads will still fail
- The plugin automatically uses HF_TOKEN for Hugging Face downloads when available
When you need this
You usually only need HF_TOKEN when:
- the model repo is gated
- the model repo is private
- Hugging Face returns 401 Unauthorized
Public Hugging Face models normally work without authentication.
The plugin adds a Model Installer button to the ComfyUI top bar when possible, with fallback to the classic left menu.
-
Scan Workflow
Scan the current graph and detect required assets -
Install Selected
Install only the selected resolved missing assets -
Install Missing
Install all resolved missing assets currently detected -
Select All Missing
Automatically select all installable missing assets -
Refresh
Refresh plugin version info and rescan -
Check Plugin Update
Check whether a newer git version is available -
Cancel Current Job
Request cancellation of the current installation job -
Only Missing
Filter the table to show only missing/downloading assets
If an asset is ambiguous or unresolved, the UI shows a Resolve button.
Clicking it opens a modal that can:
- show cached candidates
- refresh candidates from the backend
- let you manually confirm one candidate
Once confirmed, the resolution is stored locally in the resolver cache and the asset becomes installable.
During installation, the plugin tracks progress both:
Each row shows:
- size
- downloaded bytes
- percentage
- progress bar
The log shows the current job progress, for example:
Job running | Progress: 0/1 | Current: ponyRealism_v21MainVAE.safetensors | Downloading 3 GB of 30 GB (10%)
The plugin can check whether the git repository is outdated and update itself.
- check local vs remote commit
git fetch origingit pull origin main
- This only works if the plugin folder is a valid git repository
- After update, you must restart ComfyUI
Typical structure:
ComfyUI-Model-Installer/
├── __init__.py
├── routes.py
├── parser.py
├── resolver.py
├── resolver_cache.py
├── installer.py
├── security.py
├── utils.py
├── models_map.py
├── known_models.json # optional
├── resolver_cache.json # auto-generated
├── js/
│ └── model_installer.js
├── README.md
└── .gitignore
Responsible for extracting asset requirements from the workflow.
Includes support for:
- structured model metadata
- markdown notes
- inferred loader-based assets
Responsible for resolving assets that do not have full metadata.
Includes:
- cache lookup
- catalog lookup
- Hugging Face search
- candidate scoring
- auto-resolution and manual confirmation support
Stores confirmed or auto-resolved matches locally for future scans.
Handles the actual download job lifecycle:
- queue creation
- status updates
- progress tracking
- cancellation
- final installation into the correct model folder
Exposes backend API endpoints to the frontend.
GET /model-installer/pingGET /model-installer/version
POST /model-installer/scanPOST /model-installer/scan-resolve
POST /model-installer/resolve/candidatesPOST /model-installer/resolve/confirm
POST /model-installer/downloadGET /model-installer/statusPOST /model-installer/cancel
GET /model-installer/update/checkPOST /model-installer/update/plugin
The plugin maps workflow assets into known ComfyUI folders, such as:
checkpointslorasvaetext_encodersclipclip_visioncontrolnetdiffusion_modelsunetupscale_modelsstyle_modelsembeddingsaudio_encodersdiffusersLLM
The exact mapping is controlled by models_map.py.
Confirmed and auto-resolved candidates are stored locally in:
resolver_cache.json
This helps future scans resolve faster and avoids repeating manual choices.
Example entry:
{
"ponyrealism_v2.1_vae|checkpoints": {
"repo_id": "some-author/some-repo",
"filename": "ponyRealism_v21MainVAE.safetensors",
"revision": "main",
"url": "https://huggingface.co/some-author/some-repo/resolve/main/ponyRealism_v21MainVAE.safetensors",
"confidence": 97
}
}You can provide a curated catalog of known models to improve resolution quality.
Example:
{
"pony_realism_main_vae": {
"repo_id": "author/repo",
"filename": "ponyRealism_v21MainVAE.safetensors",
"revision": "main",
"directory": "checkpoints",
"aliases": [
"PonyRealism_v2.1_VAE",
"pony realism v2",
"ponyrealism"
]
}
}This file is optional. If it does not exist, the plugin will continue using cache + Hugging Face search.
The resolver includes debug logs in the backend console.
Examples:
[CMI resolver] resolve_assets start total=2
[CMI resolver] HF search start asset=PonyRealism_v2.1_VAE directory=checkpoints queries=[...]
[CMI resolver] candidate score=72 repo=author/repo file=model.safetensors reasons=[...]
These logs help diagnose:
- failed Hugging Face search
- incompatible
huggingface_hubversions - low-score candidate filtering
- missing catalog entries
Different versions of huggingface_hub may expose different HfApi.list_models(...) signatures.
The resolver includes compatibility fallbacks so it can work with different installed versions.
If the plugin folder is not a git repository, self-update features are disabled.
The plugin works best when workflows include either:
- structured
properties.models - readable model links
- standard ComfyUI loader nodes
Highly customized or obfuscated workflows may require manual resolution.
The plugin sanitizes filenames and restricts installation to allowed ComfyUI model directories.
This helps prevent:
- invalid relative paths
- unsafe filenames
- writing outside expected model folders
Possible reasons:
- model name is too ambiguous
- the model is not available on Hugging Face
- your installed
huggingface_hubversion behaves differently - the asset needs a curated
known_models.jsonentry
If the modern ComfyUI top bar API is unavailable, the plugin falls back to the left-side menu button.
MIT License
Built for ComfyUI workflow portability and model-aware installation workflows.