Nodes/Img Label Tools/DuckDuckGo img search
ComfyUI Node

DuckDuckGo img search

Grab reference images from DuckDuckGo — no API key, no account

By rjgoif·Created 9 months ago·Updated 2 months ago· 5
DuckDuckGo img search
    • image(s)
    • url(s)
    query
    start0
    num_results1
    output_type
    regionno region
    safe_searchmoderate
    sizeall
    colorall
    type_imageall
    layoutall
    license_imageall
    ai_imageshide

    DuckDuckGo img search is the odd one out in this pack - everything else is labeling and stitching, this one fetches images from the web. You type a query, it hits DuckDuckGo's image search, downloads the results, and hands you ready-to-use image tensors plus the source URLs. No API key, no account, no billing page. That's the entire appeal: most image-search nodes want you to set up a Google Custom Search or Bing key first, and this one just works.

    What would you actually do with it? Pull a stack of reference images to feed an IP-Adapter or img2img pass, grab real-world textures for depth or controlnet conditioning, or scrape a little inspiration batch to run through the rest of this very pack. It's the front end for "I need real photos of this thing" without leaving the graph.

    How it works

    Behind the scenes it uses the duckduckgo_search library's DDGS class with a 20-second timeout, then downloads each image with requests. Your filters map directly onto DuckDuckGo's own search options: region, safe_search (default moderate), size, color, type_image (photo/clipart/gif/transparent/line), layout, license_image, and ai_images (default hide, which adds DuckDuckGo's AI-image filter). start is a pagination offset - it fetches start + num_results results and slices.

    The output is image(s) plus url(s) (a list of the source URLs, aligned index-for-index with the images). One thing worth knowing: output_type switches between batch - a normal stacked tensor, which is what most nodes expect - and list, which returns a Python list of single-image tensors. If a node complains about the list form, flip it to batch.

    Install - and the one real trap

    Same install as the rest of the pack: ComfyUI Manager → search "Img Label Tools" → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/rjgoif/ComfyUI-Img-Label-Tools
    

    then restart. Here's the trap: the pack's README and requirements.txt both claim "no external dependencies," and that's true for every node except this one. The DuckDuckGo node hard-requires duckduckgo-search (and requests), which are not in requirements.txt. If you run it and hit an ImportError, the code tells you exactly what to do:

    pip install duckduckgo-search
    

    It'll also need requests, which virtually every ComfyUI install already has. The author shipped the helpful error message rather than the dependency, so budget this as a one-time manual install.

    Gotchas

    Scraping a search engine without a key means you live at DuckDuckGo's mercy. The library breaks whenever DDG changes its internals - that's a recurring community theme - and you can get rate-limited or served empty results on heavy runs. The author knows: when a download fails, the node inserts a 64×64 black placeholder instead of erroring, so the URL list stays aligned with the image list. Don't be confused by the black boxes showing up - that's the failure signal, not a bug in your graph.

    CategoryImage Label Tools

    Inputs (12)

    NameTypeDefaultDescription
    querySTRING
    startINT0
    num_resultsINT1
    output_typeCOMBO2 options: list, batch
    regionCOMBOno region20 options: no region, us-en, uk-en, ca-en, au-en, de-de, +14
    safe_searchCOMBOmoderate3 options: moderate, on, off
    sizeCOMBOall5 options: all, Small, Medium, Large, Wallpaper
    colorCOMBOall16 options: all, Monochrome, Red, Orange, Yellow, Green, +10
    type_imageCOMBOall6 options: all, photo, clipart, gif, transparent, line
    layoutCOMBOall4 options: all, Square, Tall, Wide
    license_imageCOMBOall7 options: all, any, Public, Share, ShareCommercially, Modify, +1
    ai_imagesCOMBOhide2 options: hide, show

    Outputs (2)

    NameTypeDescription
    image(s)IMAGE
    url(s)STRING