ComfyUI Node

Midjourney Scraper

Pull the Midjourney showcase into ComfyUI — but bring your cookies

By lum3on·Created about a year ago·Updated about a year ago· 4
Midjourney Scraper
    • image_paths
    search_urlhttps://midjourney.com/showcase/top/
    output_directory./Midjourney_Scraped_Images/
    num_images_to_scrape10
    timeout5
    headlesstrue
    cookies

    Midjourney has no API worth using, it's subscription-only, and the good stuff lives on its showcase pages where you can't right-click-save in bulk. This node is the workaround: it drives a real Chrome browser at a showcase URL like midjourney.com/showcase/top/, collects every image and video URL it finds, and downloads them straight into a folder on your machine. People have been scraping that showcase for years - there's a 2023 thread of someone grabbing a few images from it to fine-tune a model - and this is that impulse packaged as a ComfyUI node.

    The catch, and it's a big one: Midjourney's anti-bot protection will turn you away unless you hand the node your session cookies. The whole thing is useless without them, so read that section before you install anything.

    How it works

    The node is a browser-automation script dressed up as a ComfyUI node. It boots undetected_chromedriver - a Chrome driver tuned to look like a real user instead of a bot - and throws in --no-sandbox and --disable-dev-shm-usage, so it can run in containers and Linux boxes, not just your desktop.

    Then the real magic: if you've pasted cookies in, it splits that giant name=value; name=value string apart and injects each cookie into the browser session for the .midjourney.com domain, then loads your search_url. It scrolls the page to the bottom, waits for new images to lazy-load, and repeats until the page stops growing. Every element whose src matches cdn.midjourney.com gets its URL collected, thumbnail URL mangled into a full-resolution one (the _640_N.webp videos become .mp4, the 0_0_32_N.webp-style grid tiles become 0_0.png), and downloaded with a plain requests call that spoofs a browser User-Agent.

    The download loop is where this thing is actually decent. Each file gets up to nine retries, and anything under 10 KB is deleted and re-fetched as "likely corrupted." You won't get half-downloaded webp garbage cluttering your folder.

    The inputs that matter

    Only a few of the six inputs are ones you'll touch every time:

    • cookies - the entire cookie request header value from a logged-in browser, copied out of DevTools → Network → the page request → Request Headers. This is the difference between working and returning nothing. It's also a real security foot-gun: it's a full authenticated session, so anyone you share the string with can act as your Midjourney account. Don't paste it into a shared workflow file.
    • search_url - any showcase page. Defaults to https://midjourney.com/showcase/top/.
    • num_images_to_scrape - cap on downloads, 0–1000. Set to 0 and it grabs everything it can scroll to, which can be a lot.
    • output_directory - where files land, default ./Midjourney_Scraped_Images/.
    • headless - True runs Chrome invisibly, which is the default. If the node silently gives you nothing, flipping this off is the first troubleshooting step; a visible browser passes bot checks more often.
    • timeout - seconds to wait for the page and its scroll steps, default 5. Slow connection or a big page, raise it.

    What comes out

    The single output, image_paths, is a comma-separated string of file paths - not an image, not an image list. You can't drag it into a Preview Image node; feed it to something that reads paths from text, or just go look at output_directory. Honest limitation: files get random eight-character names, so you can't match an image back to the prompt that made it. You're getting a pile of reference images, not a prompt dataset.

    Installing it

    ComfyUI Manager, search for "MJ-Scraper" (or "Midjourney Scraper"), install, restart. Or the manual way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lum3on/ComfyUI_MJ-Scraper
    cd ComfyUI_MJ-Scraper
    pip install -r requirements.txt
    

    Then restart ComfyUI. The requirements pull in undetected-chromedriver, selenium, requests, beautifulsoup4, and webdriver-manager. There are no model files - nothing to download, no GPU work, this is pure scraping.

    Where people get burned

    This is a tiny, single-commit pack from one author, so manage your expectations: it's "works on my machine" territory, not a maintained tool. Three things bite, in order. First, undetected-chromedriver breaks every time Chrome updates - if it starts erroring out of nowhere, update Chrome and let webdriver-manager grab a matching driver. Second, cookies expire and sessions rotate; a stale cookie string returns an empty string. Re-copy it from DevTools and try again. Third, the scraping depends on Midjourney's DOM - the CSS selectors and URL patterns hardcoded in the node (cdn.midjourney.com, _640_N.webp) are the contract, and Midjourney can change them overnight. When that happens, this node dies until someone updates the repo. It's a great time-saver while it works; just don't build your pipeline on it.

    CategoryImage Scrapers

    Inputs (6)

    NameTypeDefaultDescription
    search_urlSTRINGhttps://midjourney.com/showcase/top/
    output_directorySTRING./Midjourney_Scraped_Images/
    num_images_to_scrapeINT100–1000
    timeoutINT51–60
    headlessBOOLEANtrue
    cookiesSTRING

    Outputs (1)

    NameTypeDescription
    image_pathsSTRING