Extensions/comfyui-CLIP-Search
ComfyUI Extension

comfyui-CLIP-Search

Using CLIP you can search through thousands of images in seconds.

By pointave·Created 3 months ago·Updated 3 months ago· 0
pointave/comfyui-CLIP-Search
Nodes
On cloudLocal install
Stars0
Updated3 months ago
Readme

comfyui-CLIP-Search

Tired of sorting folders with thousands of images? Instantly retrieve any picture using simple tags — color, object, scene, mood, and more.

CLIP-Search embeds your image library once, then lets you search it in natural language directly inside ComfyUI. No external tools, no manual tagging.

One issue is that the unload models and cache buttons doesnt unload the clip model, it should automatically unload if used though.


Outputs

| Output | Type | Description | |---|---|---| | Image | IMAGE | The selected or randomly picked image, ready to pipe into any node | | Path | STRING | Full file path of the selected image | | all_result_paths | STRING | Newline-separated list of all matched image paths |


Installation

1. Clone into your ComfyUI custom nodes folder:

cd ComfyUI/custom_nodes
git clone https://github.com/YOUR_USERNAME/comfyui-CLIP-Search

2. Install the dependency:

pip install open-clip-torch

3. Restart ComfyUI.

The CLIP model (ViT-L-14 / laion2B-s32B-b82K) downloads automatically on first use (~1.7 GB). I use it for another program so I have it download to .cache/huggingface/ Subsequent runs load from local cache.


Usage

  1. Add the CLIP Search node (found under 🔍CLIP/Search)
  2. Enter a folder path or pick one from your favorites
  3. Click Embed Folder — this runs once and caches results to disk
  4. Type a search term and press Enter (or click Search)
  5. Click any image in the gallery to select it as the node output
  6. (Optional) Use the 🚫 Exclude bar to filter unwanted images from the current results

The embedding cache is stored alongside your images and invalidated automatically when the image count changes. Use Re-embed to force a full refresh.


CAUTION

It seems to stay partially loaded in vram unless you push the Unload Vram button in the GUI.

Also large folders take a long time to embed, if you do one accidently I'd reccommend to restart comfyui.

Credits

OpenAI's CLIP model