Nodes/comfyui-smart-lora-downloader/Workflow LoRA Interceptor
ComfyUI Node

Workflow LoRA Interceptor

The set-and-forget LoRA downloader, if you can tame it

By LargeModGames·Created about a year ago·Updated 12 months ago· 6
Workflow LoRA Interceptor
    • status
    • missing_loras_report
    enable_auto_modefalse
    civitai_token
    download_missingtrue
    scan_current_workflowfalse
    manual_workflow_json

    This is the ambitious one. While the rest of the comfyui-smart-lora-downloader pack waits for you to click something, Workflow LoRA Interceptor sits inside ComfyUI and watches everything you queue. Enable auto-mode, paste in a CivitAI token, and every workflow you run from then on gets scanned for missing LoRAs and downloads them in the background - no pasting JSON, no running nodes manually. If it works for you, it's the "download the missing LoRAs yourself" problem evaporating.

    The caveat is right there in the README, and it's worth taking seriously: the interceptor is the most fragile node in the pack.

    How it works

    On startup, the node monkey-patches ComfyUI's execution system - specifically it replaces PromptServer.instance.prompt_queue.put, the function that every queued workflow passes through. When auto-mode is enabled, its replacement intercepts each prompt, extracts the LoRA references using the same parsing engine as the pack's LoRAAutoDownloader node, checks which files exist in your models/loras/ folder, and for anything missing it searches CivitAI and downloads it with your token.

    Monkey-patching a core function is why it's fragile: your hook is only one of several things that could touch that queue, and a ComfyUI update that changes how prompts are queued can silently break the interceptor. The README also warns you may need to run the node twice after ComfyUI startup for it to properly initialize. Keep an eye on the ComfyUI console - it logs "hooks installed successfully" when things attach.

    The inputs:

    • enable_auto_mode (default false) - the master switch. It's off by default, so nothing happens until you flip it and run the node once to store the setting.
    • civitai_token - needed for downloads; without it the node detects missing LoRAs but can't fetch them.
    • download_missing (default true) - set false to get reports without downloads.
    • scan_current_workflow (default false) - set true to scan the workflow you're running right now.
    • manual_workflow_json (optional) - paste a workflow's API-format JSON here to scan it on demand instead of waiting for a queued run.

    Outputs are a status string (what mode it's in, what it found) and missing_loras_report - both read-only, since this is an output node that configures behavior rather than feeding data downstream.

    The workflow that actually works

    1. Install the pack and restart ComfyUI.
    2. Add the node to any workflow, paste your token, set enable_auto_mode to true.
    3. Run the workflow once - the README says run it twice after startup to be safe.
    4. From then on, queued workflows get scanned; check the console log to confirm it's active.

    Then remember the pack-wide rule: ComfyUI only rescans models/loras/ at startup, so a LoRA downloaded mid-session won't appear in your Load LoRA nodes until you restart. And downloaded filenames can differ from what the workflow referenced - check the dropdown for close matches.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/LargeModGames/comfyui-smart-lora-downloader
    

    Restart ComfyUI. Its only dependency is requests, which ships with ComfyUI, and you need a free CivitAI API token (Account Settings → API Keys). Nothing heavy to install.

    When to skip it

    If the interceptor feels like it's working against you - prompts not being scanned, nothing downloading, behavior changing between ComfyUI updates - fall back to the pack's LoRAAutoDownloader node with the workflow JSON pasted in. It does the same scanning and downloading with zero magic. The interceptor is the coolest idea in this pack, and the most likely to bite. When it works, it's genuinely great set-and-forget automation; when it doesn't, don't fight it - you lose nothing by doing the manual version.

    Categoryloaders/lora

    Inputs (5)

    NameTypeDefaultDescription
    enable_auto_modeBOOLEANfalseEnable automatic LoRA detection and downloading for all workflows
    civitai_tokenSTRINGCivitAI API token for downloading models
    download_missingBOOLEANtrueAutomatically download missing LoRAs
    scan_current_workflowBOOLEANfalseScan the current workflow for LoRA usage
    manual_workflow_jsonoptSTRINGManually provide workflow JSON to scan

    Outputs (2)

    NameTypeDescription
    statusSTRING
    missing_loras_reportSTRING