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 | Search text sent to DuckDuckGo image search. | |
| start | INT | 0 | How many results to skip from the top (0 starts at the first result). |
| num_results | INT | 1 | How many results to return, counted after skipping start. |
| output_type | COMBO | list: each image is returned separately at its own size. batch: all images are padded with black to the largest width and height and returned as one batch. | |
| region | COMBO | no region | Search region and language, for example us-en. Currently has no effect: the search call only sends the query text. |
| safe_search | COMBO | moderate | Safe search level: on, moderate or off. Currently has no effect: the search call only sends the query text. |
| size | COMBO | all | Image size filter. Currently has no effect: the search call only sends the query text. |
| color | COMBO | all | Image color filter. Currently has no effect: the search call only sends the query text. |
| type_image | COMBO | all | Image type filter, such as photo, clipart or gif. Currently has no effect: the search call only sends the query text. |
| layout | COMBO | all | Shape filter: Square, Tall or Wide. Currently has no effect: the search call only sends the query text. |
| license_image | COMBO | all | Usage license filter. Currently has no effect: the search call only sends the query text. |
| ai_images | COMBO | hide | Intended to hide or show AI-generated images. Currently has no effect: the search call only sends the query text. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image(s) | IMAGE | The downloaded images. An image that fails to download becomes a 64x64 black placeholder so positions still match url(s). |
| url(s) | STRING | Source URL of each image, in the same order. |