ComfyUI Extension: ComfyUI Asset Downloader

Authored by ServiceStack

Created

Updated

6 stars

This node allows downloading models and other resources used within a ComfyUI workflow making it easier to resolve referenced assets and share workflows

Custom Nodes (0)

    README

    Comfy Asset Downloader

    A ComfyUI custom node that allows you to download models and other assets used in ComfyUI workflows from external sources like Hugging Face and CivitAI directly within your workflows to make it easier to share workflows and save time finding and downloading all the assets needed.

    Features

    • Download models, checkpoints, VAEs, and other assets from external URLs
    • Specify custom save locations within your ComfyUI models directory
    • Support for authenticated downloads using API tokens
    • Visual progress indicator during downloads
    • Embed download nodes directly in your workflows to ensure dependencies are available

    Installation

    Using ComfyUI Manager

    Search and install Comfy Asset Downloader from ComfyUI's Manager Custom Nodes Manager.

    Using Git

    git clone https://github.com/ServiceStack/comfy-asset-downloader \
        ComfyUI/custom_nodes/comfy-asset-downloader
    

    Configure Environment Variables (Optional)

    To download models and resources from CivitAI or protected Hugging Face repositories we recommend your ComfyUI instance has these environment variables (e.g. by adding to ~/.profile):

    export HF_TOKEN=hf_xxx
    export CIVITAI_TOKEN=civitai_token
    

    Restart ComfyUI after installation.

    Description

    The Asset Downloader node provides a simple interface:

    • url: The direct URL to the file you want to download
    • save_to: The subfolder within your ComfyUI models directory to save the file
    • filename: The name to save the file as
    • token (optional): API token for authenticated downloads (e.g. for CivitAI or private Hugging Face repositories)

    For ease of use and security the token can be prefixed with $ to use an environment variable (e.g. $HF_TOKEN or $CIVITAI_TOKEN) for the token available to the ComfyUI instance.

    This will use the value of the HF_TOKEN environment variable if it exists.

    Usage

    1. Add an AssetDownloader node to your workflow
    2. Set the URL to a model file (e.g., https://huggingface.co/model-repo/resolve/main/the_model.safetensors)
    3. Choose the appropriate save location (e.g. checkpoints)
    4. Set the filename (e.g., the_model.safetensors)
    5. Run the workflow - the file will be downloaded if it doesn't already exist

    Example ComfyUI Workflows

    Check out the example workflows containing asset dependencies in the examples folder:

    (Drag image to ComfyUI)

    HiDream

    Flux

    Stable Diffusion

    CivitAI (requires CIVITAI_TOKEN)

    Wan

    • wan-image-to-video.json: A workflow that downloads Wan2.1 text-to-video model from Hugging Face for generating videos from an initial image and text prompt

    Credits