Social Media Downloader (gallery-dl)
Dump an entire Instagram or Reddit gallery to disk, in one node
- output_dir
- summary
- download_count
- success
The Social Media Downloader (GalleryDLDownloader, part of the Download Tools pack) is the node you reach for when you want every image from an Instagram profile, a Reddit sub, a Pixiv artist, a Twitter account, a DeviantArt gallery - 100+ sites' worth of archives - sitting in a folder on your machine. The scraper node in the same pack pokes at whatever a page happens to render; this one calls in the specialist that does it properly.
It's a thin, honest wrapper around gallery-dl, the battle-tested Python downloader by Mike Fährmann that people have been using for years from the command line. The node builds a gallery-dl command from your settings and shells out to it. No reinvented logic to get subtly wrong, no missing corner cases - the entire 100-site feature set of gallery-dl is yours, just behind a ComfyUI node. For bulk archiving this is the one you'd actually reach for.
How it works
Paste URLs into url_list (one per line, # lines are ignored), pick where files go, hit run. The node invokes gallery-dl with your options: a per-site config file, optional browser cookies, an SQLite download archive that tracks what's already saved, resolution filtering, and a timeout. Files land organized into output_dir, sorted by site and user, and optionally into images/ / videos/ subfolders.
The inputs that matter
url_listandoutput_dir- required, self-explanatory.config_path- the key one. A singlegallery-dl.confholds credentials for every site (Instagram, Reddit, 500px, DeviantArt, Pinterest, Flickr, Bluesky) and gallery-dl auto-selects the right ones from the URL. Point it at./configs/gallery-dl.confand the path is remembered between sessions.filter_by_resolution(on by default) withmin_image_width/min_image_height- skips thumbnails and icons under 768px. Videos are never filtered. Note the honest caveat in the tooltip: sites without dimension metadata (Bunkr, Cyberdrop) download everything regardless.instagram_include-posts,stories,highlights,reels, or comma-combined. Instagram-only, and the reason the node's README leans so heavily on Instagram.download_timeout- default 1800s (30 min). Huge galleries can need hours. When it times out you just run again: the archive means it resumes where it stopped.use_browser_cookies/browser_name- leave off, per the README; the config file is more reliable than cookie-jacking.
The extra_options field is a backdoor to the full gallery-dl CLI - --limit 50, --range 1-100, --ugoira-conv for Pixiv animations, -o directory=[...] for custom folder layouts. If you know gallery-dl, you know this field.
The outputs
output_dir (STRING) - where things went, wire it anywhere you need the path; summary (STRING) - a human-readable report; download_count (INT); and success (BOOLEAN) for routing in the graph. This node doesn't feed the sampler - it's a data-acquisition step you run to build a dataset or reference folder.
Installing it
ComfyUI Manager, search "Download Tools." Or:
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Download_Tools
cd Download_Tools && pip install -r requirements.txt
gallery-dl installs as a Python dependency - no separate binary, no browser download. FFmpeg is only needed for niche extras like ugoira conversion.
Where it bites
- 401 Unauthorized on Instagram - expired session cookies (they die after roughly a year). Export fresh ones via the "Get cookies.txt LOCALLY" browser extension into the config file.
- Chrome cookies unreachable - Chrome locks its cookie DB while running; close it, run ComfyUI as admin, or just use Firefox.
- Too many small images - that's the resolution filter being off, or a site that reports no dimensions.
- Timeout - bump
download_timeout(up to 10 hours) and re-run; it resumes.
One word of caution, since this node's whole job is downloading from sites that often frown on it: it's a non-commercial (CC BY-NC 4.0) pack with a separate commercial license, and you're responsible for what you archive and how you use it. For your own content and clearly okay-to-keep material, it's superb.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| url_list | STRING | # Enter URLs here, one per line # Supports 100+ sites: Instagram, Reddit, Twitter/X, DeviantArt, Pixiv, 500px, Flickr, Pinterest, Bluesky, and more # Examples: # https://www.instagram.com/username/ # https://www.reddit.com/r/subreddit/ # https://twitter.com/username | Enter URLs to download from, one per line. Supports Instagram, Reddit, Twitter/X, DeviantArt, Pixiv, 500px, Flickr, Pinterest, Bluesky, and 90+ other sites. Lines starting with # are ignored. |
| output_dir | STRING | ./gallery-dl-output | Directory where downloaded files will be saved. Relative paths are relative to ComfyUI's output folder. Files are organized into subfolders by site and user. |
| url_fileopt | STRING | Optional: Path to a text file containing URLs (one per line). Useful for batch downloading from a prepared list. Leave empty to use url_list above. | |
| config_pathopt | STRING | Path to gallery-dl.conf config file. This single file contains credentials for ALL sites (Instagram, Reddit, 500px, etc.) - gallery-dl auto-selects the right ones based on URL. Path is auto-saved for next time. Recommended: ./configs/gallery-dl.conf | |
| cookie_fileopt | STRING | Path to exported cookie file (Netscape/JSON format). Only used when 'Use Browser Cookies' is OFF and you need site-specific cookies not in config. Usually leave empty - config file credentials work better. Path is auto-saved. | |
| use_browser_cookiesopt | BOOLEAN | false | OFF (recommended): Use credentials from config file - most reliable. ON: Extract cookies directly from browser (Firefox works best; Chrome/Edge require admin rights and browser closed). |
| browser_nameopt | COMBO | firefox | Browser to extract cookies from when 'Use Browser Cookies' is ON. Firefox recommended - works without admin rights. Chrome/Edge need admin + browser closed. |
| use_download_archiveopt | BOOLEAN | true | ON (recommended): Track downloaded files in SQLite database to skip duplicates on future runs. OFF: Re-download everything, may create duplicates. |
| archive_fileopt | STRING | ./gallery-dl-archive.sqlite3 | Path to download archive database (SQLite). Tracks what's been downloaded to avoid duplicates. Delete this file to force re-downloading everything. |
| skip_videosopt | BOOLEAN | false | ON: Download only images, skip all video files. OFF: Download both images and videos. Useful when you only want still images from a mixed gallery. |
| filter_by_resolutionopt | BOOLEAN | true | ON: Skip images smaller than min_image_width/height (removes thumbnails, icons, low-res images). Videos are never filtered. Sites without dimension metadata (Bunkr, Cyberdrop) will download all images. OFF: Download all images regardless of size. |
| min_image_widthopt | INT | 7680–8192 | Minimum image width in pixels when filter_by_resolution is ON. Images narrower than this are skipped. Set to 0 to disable width filtering. Note: Sites that don't provide dimension metadata will download all images. |
| min_image_heightopt | INT | 7680–8192 | Minimum image height in pixels when filter_by_resolution is ON. Images shorter than this are skipped. Set to 0 to disable height filtering. Note: Sites that don't provide dimension metadata will download all images. |
| extract_metadataopt | BOOLEAN | true | ON: Save download metadata to JSON file (URLs, timestamps, file counts, errors). Useful for tracking what was downloaded. OFF: No metadata file created. |
| organize_filesopt | BOOLEAN | true | ON: Sort downloaded files into subfolders by type (images/, videos/, audio/, other/). OFF: Put all files in the main output folder without sorting. |
| instagram_includeopt | COMBO | posts | Instagram only: What content to download. 'posts' = feed posts, 'stories' = current stories (24hr), 'highlights' = saved story highlights, 'reels' = reels videos, 'all' = everything. Combine with comma: 'posts,reels'. |
| download_timeoutopt | INT | 180060–36000 | Maximum time in seconds for this run. Default 1800s (30 min). For huge galleries: 7200=2hr, 14400=4hr, 28800=8hr. TIP: If it times out, just run again - gallery-dl automatically resumes from where it left off using the download archive! |
| extra_optionsopt | STRING | Advanced gallery-dl options (one per line or space-separated): • --limit N: Max N files to download • --range 1-50: Download items 1-50 only • --no-download: Simulate without downloading • --write-metadata: Save per-file JSON metadata • --ugoira-conv: Convert Pixiv ugoira to video • -v: Verbose output for debugging • --sleep N: Wait N seconds between requests • --retries N: Retry failed downloads N times Folder organization examples: • Kemono by post: -o directory=["{service}","{user}","{id}_{title}"] • Flat by user: -o directory=["{category}","{user}"] See docs: https://github.com/mikf/gallery-dl/blob/master/docs/options.md | |
| seedopt | INT | 00–18446744073709550000 | Random seed to force re-execution. Click 🎲 to randomize or change manually. Useful for resuming downloads after timeout - change the seed to run again without modifying other settings. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| output_dir | STRING | — |
| summary | STRING | — |
| download_count | INT | — |
| success | BOOLEAN | — |