Nodes/Download Tools for ComfyUI/Social Media Downloader (gallery-dl)
ComfyUI Node

Social Media Downloader (gallery-dl)

Dump an entire Instagram or Reddit gallery to disk, in one node

By EricRollei·Created 9 months ago·Updated 7 months ago· 6
Social Media Downloader (gallery-dl)
    • output_dir
    • summary
    • download_count
    • success
    url_list# 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
    output_dir./gallery-dl-output
    url_file
    config_path
    cookie_file
    use_browser_cookiesfalse
    browser_namefirefox
    use_download_archivetrue
    archive_file./gallery-dl-archive.sqlite3
    skip_videosfalse
    filter_by_resolutiontrue
    min_image_width768
    min_image_height768
    extract_metadatatrue
    organize_filestrue
    instagram_includeposts
    download_timeout1800
    extra_options
    seed0

    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_list and output_dir - required, self-explanatory.
    • config_path - the key one. A single gallery-dl.conf holds 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.conf and the path is remembered between sessions.
    • filter_by_resolution (on by default) with min_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.

    CategoryDownloaders

    Inputs (19)

    NameTypeDefaultDescription
    url_listSTRING# 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/usernameEnter 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_dirSTRING./gallery-dl-outputDirectory 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_fileoptSTRINGOptional: 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_pathoptSTRINGPath 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_fileoptSTRINGPath 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_cookiesoptBOOLEANfalseOFF (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_nameoptCOMBOfirefoxBrowser to extract cookies from when 'Use Browser Cookies' is ON. Firefox recommended - works without admin rights. Chrome/Edge need admin + browser closed.
    use_download_archiveoptBOOLEANtrueON (recommended): Track downloaded files in SQLite database to skip duplicates on future runs. OFF: Re-download everything, may create duplicates.
    archive_fileoptSTRING./gallery-dl-archive.sqlite3Path to download archive database (SQLite). Tracks what's been downloaded to avoid duplicates. Delete this file to force re-downloading everything.
    skip_videosoptBOOLEANfalseON: 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_resolutionoptBOOLEANtrueON: 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_widthoptINT7680–8192Minimum 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_heightoptINT7680–8192Minimum 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_metadataoptBOOLEANtrueON: Save download metadata to JSON file (URLs, timestamps, file counts, errors). Useful for tracking what was downloaded. OFF: No metadata file created.
    organize_filesoptBOOLEANtrueON: Sort downloaded files into subfolders by type (images/, videos/, audio/, other/). OFF: Put all files in the main output folder without sorting.
    instagram_includeoptCOMBOpostsInstagram 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_timeoutoptINT180060–36000Maximum 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_optionsoptSTRINGAdvanced 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
    seedoptINT00–18446744073709550000Random 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)

    NameTypeDescription
    output_dirSTRING
    summarySTRING
    download_countINT
    successBOOLEAN