ComfyUI Extension: ComfyUI-OnDemand-Lora-Loader
This is a custom node for ComfyUI that allows you to download and apply LoRA models directly from Civitai/HuggingFace. It simplifies your workflow by managing LoRA downloads automatically, so you don't have to manually download files and place them in the correct folder.
Custom Nodes (0)
README
ComfyUI-OnDemand-Lora-Loader
This is a custom node for ComfyUI that allows you to download and apply LoRA models directly from Civitai/HuggingFace. It simplifies your workflow by managing LoRA downloads automatically, so you don't have to manually download files and place them in the correct folder.
Features
- Automatic Downloading: Downloads LoRA models from Civitai/HuggingFace URLs specified in a configuration file.
- No Re-downloads: Checks if a LoRA file already exists before attempting to download it.
- Progress Bar: Displays a progress bar in the console during download.
- Private Model Support: Access private or early-access models using your Civitai/HuggingFace API key.
- Centralized Configuration: Manage your list of LoRAs from a simple
config.jsonfile. - Seamless Integration: Functions as a standard LoRA loader node within the ComfyUI interface.
Installation
- Navigate to your ComfyUI
custom_nodesdirectory:cd ComfyUI/custom_nodes/ - Clone this repository:
git clone https://github.com/francarl/ComfyUI-OnDemand-Lora-Loader.git - Install the required dependencies:
cd ComfyUI-OnDemand-Lora-Loader pip install -r requirements.txt - Restart ComfyUI.
Usage
1. Configure Your LoRAs
After installation, you need to configure the LoRAs you want to use.
- Navigate to the
ComfyUI/custom_nodes/ComfyUI-OnDemand-Lora-Loader/directory. - Create a file named
config.json. If the file does not exist, the node will fall back to a default example configuration. - Add your LoRAs to the
config.jsonfile. 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. It should look like https://civitai.com/api/download/models/MODEL_ID or https://huggingface.co/user/folder/resolve/main/loras.safetensors.
Example config.json:
{
"loras": [
{
"name": "Epi Noise Offset",
"url": "https://civitai.com/api/download/models/16576"
},
{
"name": "High Lora",
"url": "https://huggingface.co/lightx2v/Wan2.2-Lightning/resolve/main/Wan2.2-T2V-A14B-4steps-lora-rank64-Seko-V1.1/high_noise_model.safetensors"
},
{
"name": "My Private Lora",
"url": "https://civitai.com/api/download/models/123456?type=Model&format=SafeTensor"
}
]
}
2. Add the Node in ComfyUI
- In ComfyUI, double-click on the canvas to open the search menu.
- Search for and add the
OnDemand Lora Loadernode. - Connect it in your workflow just as you would with a standard
LoraLoadernode.
3. Node Inputs
model: The input model from a checkpoint loader.clip(optional): The input CLIP from a checkpoint loader.lora_name: A dropdown menu to select the LoRA you configured inconfig.json.strength_model: The strength of the LoRA applied to the model.strength_clip: The strength of the LoRA applied to the CLIP model.api_key(optional): Your API key. Use this to download private or early-access models. Alternatively, you can set theCIVITAI_TOKENandHUGGINGFACE_TOKENenvironment variable.download_chunks(optional): The chunk size (in KB) for downloading files. Adjust if you experience slow downloads.
The first time you select a LoRA, it will be downloaded to your ComfyUI/models/loras/ directory. Subsequent uses will load the existing file.
License
This project is licensed under the MIT License. See the LICENSE.txt file for details.