7e91c8c7e22cba83ee8a5e32bfa6225fdfbfbe37
ComfyUI OnDemand Loaders
This is a suite of custom nodes for ComfyUI that allows you to download and apply various models directly from Civitai or HuggingFace. It simplifies your workflow by managing model downloads automatically, so you don't have to manually download files and place them in the correct folders.
Features
- Automatic Downloading: Downloads models from Civitai/HuggingFace URLs specified in a configuration file.
- On-Demand Loading: Models are downloaded only when they are needed for a workflow.
- Centralized Configuration: Manage your list of LoRAs, Checkpoints, VAEs, and more from a single
config.jsonfile. - No Re-downloads: Checks if a model file already exists before attempting to download it.
- Console Progress Bar: Displays a tqdm progress bar in the console during download.
- Private Model Support: Access private or early-access models using your Civitai or HuggingFace API key. Environment variables (
CIVITAI_TOKEN,HUGGINGFACE_TOKEN) are also supported. - Seamless Integration: Functions as standard loader nodes within the ComfyUI interface.
Available Nodes
This package includes the following nodes:
OnDemand Lora LoaderOnDemand Checkpoint LoaderOnDemand VAE LoaderOnDemand UNET LoaderOnDemand CLIP LoaderOnDemand GGUF Loader(Note: Requires ComfyUI-GGUF to be installed.)
Installation
- Navigate to your ComfyUI
custom_nodesdirectory:cd ComfyUI/custom_nodes/ - Clone this repository:
git clone https://github.com/francarl/ComfyUI-OnDemand-Loaders.git - Install the required dependencies:
cd ComfyUI-OnDemand-Loaders pip install -r requirements.txt - Restart ComfyUI.
Usage
1. Configure Your Models
After installation, create and configure a config.json file to list the models you want to access.
- In the
ComfyUI/custom_nodes/ComfyUI-OnDemand-Loaders/directory, create a file namedconfig.json. You can use theexample/config.jsonfile as a template. Ifconfig.jsondoes not exist, the nodes will fall back to a default example configuration. - Add your models to
config.json, organized by type (loras,checkpoints,vae_models, etc.). Each entry requires aname(which will appear in the node's dropdown menu) and aurl(the Civitai/HuggingFace download link).
You can get the download link from a model's page on Civitai/HuggingFace by right-clicking the download button and copying the link address.
Example config.json:
{
"loras": [
{
"name": "epi_noiseoffset",
"url": "https://civitai.com/api/download/models/16576"
},
{
"name": "Studio Ghibli Style LoRA",
"url": "https://civitai.com/api/download/models/7657"
}
],
"checkpoints": [
{
"name": "v1-5-pruned-emaonly-fp16",
"url": "https://huggingface.co/Comfy-Org/stable-diffusion-v1-5-archive/resolve/main/v1-5-pruned-emaonly-fp16.safetensors"
}
],
"vae_models": [
{
"name": "SDXL VAE",
"url": "https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors"
}
],
"clip_models": [
{
"name": "OpenCLIP ViT-H-14",
"url": "https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/pytorch_model.bin"
}
],
"gguf_models": [
{
"name": "Wan2.2-T2V-A14B-HighNoise-Q2_K",
"url": "https://huggingface.co/QuantStack/Wan2.2-T2V-A14B-GGUF/resolve/main/HighNoise/Wan2.2-T2V-A14B-HighNoise-Q2_K.gguf"
}
]
}
2. Add the Nodes in ComfyUI
- In ComfyUI, double-click on the canvas to open the search menu.
- Search for and add one of the
OnDemand ... Loadernodes (e.g.,OnDemand Checkpoint Loader). - Select the desired model from the dropdown. The first time you queue a workflow with a new model, it will be automatically downloaded to the corresponding directory inside
ComfyUI/models/. - Connect the node in your workflow just as you would with a standard loader. An example workflow can be found in
example/workflow_example.json.
3. Common Node Options
..._name: A dropdown menu to select the model you configured inconfig.json.api_key(optional): Your API key for Civitai or HuggingFace. Use this to download private or early-access models. Alternatively, you can set theCIVITAI_TOKENorHUGGINGFACE_TOKENenvironment variables.download_chunks(optional): The chunk size (in KB) for downloading files. The default is 4KB.
License
This project is licensed under the MIT License. See the LICENSE.txt file for details.
Languages
Python
42.2%
JavaScript
31%
CSS
26.8%