Download File
Download File turns remote images and audio into IMAGE/AUDIO
- image
- audio
- filepath
- mime
ComfyUI's stock Load Image node only reads files you've already dropped into your input folder. Want to pull a reference image straight from a URL - a Discord CDN link, an album cover, a clip you host on your own server - and feed it into img2img or an upscaler? Normally that means manually downloading the file, restarting ComfyUI, and hunting for it in the file picker. This single node from the serious-factory pack kills that whole dance: give it a URL, and it fetches the file into ComfyUI's temp directory and hands you back a ready-to-wire IMAGE or AUDIO tensor. No API keys, no extra server, no restart. It's exactly as simple as it sounds, which is the point.
The name is a small lie worth knowing: it doesn't call any API and needs no key. It's a plain requests GET under the hood, streamed in 8KB chunks so it doesn't eat your RAM, written to folder_paths.get_temp_directory(). The file extension comes from the URL if present, otherwise it's guessed from the response's content-type header. Then the fun part: if it looks like an image it's opened with Pillow, converted to RGB, normalized to 0–1 floats, and returned as a (1, H, W, 3) tensor - the exact shape every ComfyUI image node expects. If it's audio, PyAV decodes it into a waveform dict with a sample rate, which is the native AUDIO format for the built-in audio nodes. Whichever type it isn't comes back as an empty placeholder tensor, and only one of the two is actually populated.
The inputs that matter
Only three knobs, and you'll realistically touch two:
- url (required) - an
http(s)://link, or a local path. Bonus: it also accepts a plain local file path, so it doubles as a "load from anywhere on disk" node. - expect_type -
auto(default),image, oraudio. Leave it on auto unless the URL is ambiguous (no extension, weird MIME). Forcingimageoraudioskips the sniffing and just decodes. - max_mb - caps the download size, default 50 MB, up to 200. Handy if you're pulling from an untrusted host and don't want a surprise 4 GB "small file."
Outputs are image (IMAGE), audio (AUDIO), plus filepath and mime (both STRING) if you need the actual temp path or content type downstream - say, to feed a local path into a node that wants one, or to log what you fetched.
Installing it
Via ComfyUI Manager: search for Download File and hit install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/serious-factory/ComfyUI-DownloadFile.git
cd ComfyUI-DownloadFile
pip install -r requirements.txt
Then restart ComfyUI. Dependencies are light - requests, numpy, pillow, torch, torchaudio - no model downloads, nothing that'll eat your disk. One genuine gotcha: the code imports PyAV (av) for audio decoding, and the pack's own requirements.txt doesn't declare it. It works out because ComfyUI core ships PyAV itself, so on any normal install the node just loads. But if you're on a stripped-back ComfyUI build and the node fails to appear, missing av is your first suspect:
pip install av
Troubleshooting and sharp edges
The safety features are real, and they're the most likely source of "why did this fail" moments. The node blocks private and loopback IPs before even connecting - SSRF protection, so you can't point it at localhost or your router admin page. That means a valid-looking intranet URL will throw Refusing to access private or invalid host. Connection and read timeouts are hard-coded (5s to connect, 15s to read), so a slow CDN can time out. Anything over max_mb raises "File exceeds allowed size limit," and unsupported types (PDFs, videos, random binaries) get rejected outright by the MIME/extension allowlist - images are jpg/png/webp/gif, audio is mp3/wav/flac/ogg/m4a/aac.
One thing that bites people in practice: since only one output is populated, wiring both image and audio downstream and expecting both to be real will give you a 1×1×1×3 dummy tensor on the empty side. Decide which type you're fetching, set expect_type accordingly, and wire just that output. For a download-then-process workflow - reference image from a URL into img2img, or a voiceover clip into an audio pipeline - this is the node you'd reach for: no temp-file bookkeeping, no browser, just paste a URL and run.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| url | STRING | https://example.com/file.jpg | — |
| expect_typeopt | COMBO | auto | 3 options: auto, image, audio |
| max_mbopt | INT | 501–200 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| audio | AUDIO | — |
| filepath | STRING | — |
| mime | STRING | — |