Nodes/google-image-comfyui-node/Google Image Search
ComfyUI Node

Google Image Search

The 'Google' Image Search node that's secretly DuckDuckGo

By christian-byrne·Created 2 years ago·Updated 2 years ago· 3
Google Image Search
    • image
    • mask
    search_phrasea golden retriever puppy
    safesearchoff
    sizeany
    time_periodany
    colorany
    type_imagephoto
    layoutany
    license_imageany
    regionus-en

    The name is a lie, and the good kind. This node doesn't call the Google API, doesn't need a key, and in fact has never seen Google. It's a DuckDuckGo image scraper wrapped in a ComfyUI node - type a phrase like "a golden retriever puppy," and it runs a live search, downloads a matching image into your input folder, and hands you a ready-to-use IMAGE tensor plus an alpha MASK. "Google Image Search" is marketing; the mechanism is duckduckgo_search. Don't let that put you off. For pulling reference photos into a workflow without manually saving files into ComfyUI/input, it does exactly what it says on the tin.

    Why you'd reach for it

    The README's example flows tell the real story: Google Image → Text (Caption) → Image. You search a reference image, run it through a captioning node, and feed the caption back as a prompt. The output is a genuine IMAGE tensor, so the same search result can also feed an img2img sampler, a ControlNet preprocessor, or an IPAdapter reference instead - reference-chasing without ever leaving the graph. It's a data node in ComfyUI's plumbing layer: no model, no pixels of its own, just a way to get outside content into the pipeline.

    How it works

    Under the hood it's two dependencies doing the work: duckduckgo_search runs the actual image query, and fastdownload pulls the file. The node requests up to three results (max_results=3), downloads each into ComfyUI/input/image_downloads/, then loads the first one that opens cleanly, skipping any that fail. The MASK output is the image's alpha channel, inverted - so a transparent PNG comes out with a usable mask - and zeros if there's no alpha.

    One genuinely fun mechanism: every filter dropdown includes a Random option, and when you pick it the node shuffles that filter's choices and pops one until it lands on a real value. So you can lock your search phrase and let size, color, and region roll dice every run.

    The inputs that matter

    Every input has a default, so the node runs if you only touch search_phrase - that's the single field beginners actually set. The rest are DDG's native image filters exposed as dropdowns:

    • search_phrase - what to search, multiline, defaults to "a golden retriever puppy."
    • safesearch - on, moderate, or off (default off).
    • size, time_period, color, type_image, layout, license_image, region - filters, each with Random. If you're building a licensed reference set, set license_image; otherwise leave them alone.

    Outputs: image (IMAGE) wires into anything that takes an image, and mask (MASK) into masking/inpainting. Because it's an output node, it also emits a UI text box with the JSON of the first result - title, URL, and download path - useful for auditing what you actually got.

    Installing it

    ComfyUI Manager can find it, but the repo name has a typo - google-image-comyui-node (yes, "comyui") - so search "google-image" or by the author christian-byrne. Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/christian-byrne/google-image-comyui-node
    cd google-image-comyui-node
    pip install -r requirements.txt
    

    Then restart ComfyUI. The shipped requirements.txt installs duckduckgo_search>=7.0.0, fastcore, and fastdownload. Note the README says duckduckgo_search==5.2.1 but the actual requirements file asks for 7.0.0+ - trust the requirements file. If you hit a pip conflict, that version range is the first suspect.

    Common issues

    The one real gotcha is the author's own warning: 202 errors mean DuckDuckGo is rate-limiting you. This is a scraper, not an API, and DDG pushes back on bursts - the fix is a VPN or just waiting a while. It's inherent to the design, so don't expect a permanent cure.

    Also worth knowing: downloads accumulate in input/image_downloads/ and never clean up after themselves, so delete that folder periodically. Each run is a live web call, so results change run to run, and on niche queries DDG can return nothing usable - the node just logs the failures and moves on. And with a three-result cap and one image out, this is a reference grabber, not a batch downloader.

    Categorydata

    Inputs (9)

    NameTypeDefaultDescription
    search_phraseSTRINGa golden retriever puppy
    safesearchCOMBOoff4 options: on, moderate, off, Random
    sizeCOMBOany6 options: any, Small, Medium, Large, Wallpaper, Random
    time_periodCOMBOany6 options: Day, Week, Month, Year, any, Random
    colorCOMBOany15 options: any, Monochrome, Red, Orange, Yellow, Green, +9
    type_imageCOMBOphoto7 options: any, photo, clipart, gif, transparent, line, +1
    layoutCOMBOany5 options: any, Square, Tall, Wide, Random
    license_imageCOMBOany7 options: any, Public, Share, ShareCommercially, Modify, ModifyCommercially, +1
    regionCOMBOus-en5 options: wt-wt, us-en, uk-en, ru-ru, Random

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    maskMASK