DuckDuckGo img search
Grab reference images from DuckDuckGo — no API key, no account
- image(s)
- url(s)
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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| query | STRING | — | |
| start | INT | 0 | — |
| num_results | INT | 1 | — |
| output_type | COMBO | 2 options: list, batch | |
| region | COMBO | no region | 20 options: no region, us-en, uk-en, ca-en, au-en, de-de, +14 |
| safe_search | COMBO | moderate | 3 options: moderate, on, off |
| size | COMBO | all | 5 options: all, Small, Medium, Large, Wallpaper |
| color | COMBO | all | 16 options: all, Monochrome, Red, Orange, Yellow, Green, +10 |
| type_image | COMBO | all | 6 options: all, photo, clipart, gif, transparent, line |
| layout | COMBO | all | 4 options: all, Square, Tall, Wide |
| license_image | COMBO | all | 7 options: all, any, Public, Share, ShareCommercially, Modify, +1 |
| ai_images | COMBO | hide | 2 options: hide, show |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image(s) | IMAGE | — |
| url(s) | STRING | — |