ComfyUI Node

Requires Asset

Make your workflow download its own models (so the person you share it with doesn't have to)

By ServiceStack·Created about a year ago·Updated about a year ago· 22
Requires Asset
      urlhttps://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_4step.safetensors
      save_tocheckpoints
      filenamesdxl_lightning_4step.safetensors
      token

      If you've ever loaded a workflow from a stranger on the internet, you know the drill: ComfyUI Manager fixes the missing nodes, and then you're on your own for the missing models. ComfyUI Manager can't download a checkpoint for you - it installs code, not gigabytes. So you track down the right CivitAI page, fight with a 6 GB download, and pray the version you grabbed matches what the workflow author used. AssetDownloader is the answer to exactly that problem: a node you drop into a workflow that pulls whatever file it's pointed at straight into your models folder. Share a workflow that includes it, and the recipient just hits Run.

      It's a small but neat idea, and the pack's examples lean on it hard - it ships with ready-to-run workflows for HiDream-I1, FLUX.1-schnell, SDXL-Lightning, SD3.5 Large FP8, and a stack of CivitAI models. The node's display name is literally "Requires Asset," which is the whole pitch in two words.

      How it works

      Under the hood it's a side-effect node: no outputs, nothing to wire into. You give it a URL, a destination folder, and a filename; when the workflow runs, it streams the file to save_to + filename inside your ComfyUI models directory. It's idempotent - if the file already exists, it prints "already exists" and does nothing, so reruns are free. Downloads go to a .tmp file first and only get renamed into place when complete, so an interrupted download won't leave you with a corrupt .safetensors that ComfyUI happily tries to load.

      Progress is handled twice: a tqdm bar in the console, and - the part people notice - a blue progress fill painted right on the node's title bar, pushed from the server via the same progress event API the frontend uses. The save_to path is also sanitized against walking outside the models directory, which is a thoughtful touch you don't see in every downloader.

      The inputs that matter

      There are only four, and you'll set all of them on first use:

      • url - the direct link to the file. Hugging Face resolve/main/... URLs work, as do CivitAI download links. Defaults to an SDXL-Lightning model, but you'll replace it.
      • save_to - a dropdown of your actual model subfolders (checkpoints, vae, loras, etc.), scanned live from your install. Pick where the file belongs.
      • filename - what to save it as. This can differ from the URL's filename, which is handy for the "same model, renamed on CivitAI" problem.
      • token - optional, and the smart bit. It's a password field, and prefixing the value with $ makes it read an environment variable, so you can put $HF_TOKEN or $CIVITAI_TOKEN and never paste a secret into a shared workflow. The README suggests exporting both variables in ~/.profile.

      Note the node has no outputs - the loaders downstream can't depend on it, which brings us to the gotchas.

      Installing it

      Via ComfyUI Manager, search for Comfy Asset Downloader. Or, the manual way:

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

      Then restart ComfyUI. There are no heavy dependencies to worry about - the pack only needs requests and tqdm, both of which ComfyUI already ships. If you want CivitAI or gated Hugging Face downloads to work without pasting tokens everywhere, set the environment variables:

      export HF_TOKEN=hf_xxx
      export CIVITAI_TOKEN=your_token
      

      Where people get burned

      The one real trap is the first-run dance. Because the node returns nothing, your CheckpointLoader and friends can't wait on it - they'll fire before the download finishes, and your first run may end in errors while the file pulls in the background. The author is upfront about this: the first run "kicks off the downloads," then you rerun the workflow and it works. It's a fine trade for a 6 GB file you'd otherwise hunt down by hand, but don't expect magic dependency ordering. Also, since the URL is just a direct link, gated repos and CivitAI downloads need that token field filled (or the env var referenced) or you'll get a 401. That's the whole list - it's a thin, honest node, and it works.

      One aside: it comes from ServiceStack, the .NET API framework company - a slightly unexpected source for a ComfyUI tool, but the code is clean and the examples genuinely run. If you share workflows with people who aren't model-hoarders yet, this is the easiest way to make the graph self-serve.

      Categoryloaders

      Inputs (4)

      NameTypeDefaultDescription
      urlSTRINGhttps://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_4step.safetensors
      save_toCOMBOcheckpoints26 options: model_patches, gligen, latent_upscale_models, vae, unet, clip_vision, +20
      filenameSTRINGsdxl_lightning_4step.safetensors
      tokenoptSTRING

      Outputs (0)

      No outputs