Nodes/honda-nodes/πŸ› οΈ Download Files
ComfyUI Node

πŸ› οΈ Download Files

Pull models from a URL inside the graph, and mind the tokens

By AvarayΒ·Created 14 days agoΒ·Updated 12 days agoΒ· 0
πŸ› οΈ Download Files
      β—„downloads_config[]β–Ί
      β—„civitai_tokenβ–Ί
      β—„hf_tokenβ–Ί

      A downloader that doesn't run when you press Queue

      This one is different from everything else in honda-nodes. It has a UI - a list of rows, each row a directory and a URL, plus an "Add File" and a "πŸ“₯ Download All Files" button - and it does its work when you click, not when the workflow executes. The execute() method is literally an empty return, by design. The node is an output node, so it's part of the graph, but pressing Queue downloads nothing.

      Read that as a feature: model downloads are 6GB of network traffic and you did not want them re-checking every time you queue a prompt. The node is a bookmark manager with a progress bar, living on the canvas next to the workflow that needs the files.

      How it works

      Each row takes a URL and a directory. The directory is the clever bit: if it's absolute, it's used as-is; if it's relative, it's resolved against ComfyUI's base path. So models/checkpoints means your checkpoints folder, portably, without hardcoding D:\ComfyUI\models\checkpoints in a workflow you might share.

      The node then does the polite things a hand-rolled downloader forgets: it resolves the real filename from the Content-Disposition header (so a CivitAI API URL that ends in a numeric ID saves as flux-dev-fp8.safetensors instead of 123456), it validates URLs with a HEAD request and flags dead ones in red, it detects two rows that would land on the same path, and it resumes interrupted downloads using HTTP Range headers. Cancel doesn't delete the partial file, so retrying picks up where it stopped.

      Auth is handled per-host, and the details are worth knowing because they explain why naive downloaders fail on CivitAI: for CivitAI the token is appended as a ?token= query parameter, not a header - because CivitAI redirects to Cloudflare R2 / AWS S3 pre-signed URLs, and S3 rejects a request carrying both a signature and an Authorization header. For HuggingFace it's a normal Authorization: Bearer header, which is what private repos expect.

      The inputs - and the leak

      Three STRING fields, all socketless in the schema, meaning they're part of the node's UI rather than wireable inputs: Downloads (the internal JSON config the UI writes as you add rows), API Token CivitAI, and API Token HuggingFace.

      Here's the part that deserves a bold line. Those tokens are saved in the workflow JSON in plaintext, and the node's own changelog says so explicitly - they live in hidden socketless widgets so they don't conflict with the manual-only execution model. Which is fine on your own machine and a genuine footgun the moment you post the workflow, share the PNG, or push it to a repo. Treat any workflow containing this node as a secret before you share it.

      Install

      Manager: Extensions β†’ Node Pack β†’ search "Honda Nodes" β†’ Install β†’ restart. Manual:

      cd ComfyUI/custom_nodes
      git clone --depth 1 https://github.com/Avaray/honda-nodes.git
      cd honda-nodes
      python install.py     # ComfyUI's python; portable Windows: ..\..\..\python_embeded\python.exe install.py
      

      The downloader is pure Python (urllib plus a few ComfyUI server routes) - no external binaries. The installer's jq/ime downloads are for other nodes in the pack. ComfyUI 0.38.0+ required.

      Common issues

      Every URL shows as invalid. Version 1.2.0 fixed a false-positive that flagged any URL containing the string "auth", which broke pre-signed S3 links; earlier builds also sent Authorization: Bearer alongside ?token= to CivitAI, which S3 and R2 answer with 400 Bad Request. If CivitAI downloads fail while free models work, check your pack version first.

      Free CivitAI models marked invalid. Also fixed in 1.2.0: CivitAI answers 403 to HEAD requests on free models, so the check now falls back to a GET.

      Download finishes but the file isn't where you expected. Relative directory against ComfyUI's base path. models/loras is right for a standard install; a custom extra_model_paths.yaml setup with models on another drive isn't something this node knows about.

      Nothing happens on Queue. Correct. Click the download button on the node. Note also that the file list lives in the workflow, so a downloaded model doesn't disappear from the node - it just shows as already downloaded.

      Category⚑️ Honda Nodes/πŸ› οΈ Tools

      Inputs (3)

      NameTypeDefaultDescription
      downloads_configSTRING[]Internal JSON configuration of downloads
      civitai_tokenSTRINGOptional API token for CivitAI to download models that require authentication.
      hf_tokenSTRINGOptional API token for HuggingFace to download models from private repositories.

      Outputs (0)

      No outputs