LoadDB
The little loader that gets your image database into the graph
- img_db
- IMG_DB
LoadDB is the front door of the ClipVision_Tools pack: it reads one of your generated embedding databases and hands it to the graph. It's a tiny node - a dropdown, a path field, and one output - but two details inside it cause more confusion than everything else in the pack combined. Get those two right and the rest of the workflow just works.
What it does
It reads the JSON database from ComfyUI/models/EmbDBs (a folder the pack registers), and reconstructs each entry's full file path by joining the stored relative path to the path_to_images_folder you type in. That second field is the first gotcha: it's not a browse-to-anywhere box, it's the base path the database was generated against. The DB stores folder/img.jpg; LoadDB turns it back into /your/absolute/path/folder/img.jpg. Point it at the wrong folder and every result file-not-founds.
The inputs that matter
- db_name - a dropdown listing every
.jsoninmodels/EmbDBs. This is the database. - path_to_images_folder - the absolute base path to your image collection (see above).
- img_db (optional) - chain a second LoadDB into this socket to search multiple databases at once. This is the pack's "search everything" feature: concatenate several DBs and Image Searcher scores them together.
Output is IMG_DB, which wires into Image Searcher, EditDB, or another LoadDB's chaining input.
The second gotcha: caching
The node caches its loaded data and only reloads when the database name or the base path changes. That's usually a good thing - loading a 100k-image DB is not instant - but it means if you edit a database file on disk and re-run without changing either field, you'll keep getting the old data. Change something (or use a fresh node instance) to force a reload.
Installing it
Same as the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/MoonMoon82/ClipVision_Tools
cd ClipVision_Tools
python -m pip install -r requirements.txt
Or ComfyUI Manager → "ClipVision_Tools" → restart. Deps are orjson (which does the fast JSON parsing) and pillow-heif; no model download of its own.
Troubleshooting
- "Error loading database file" in the console → the JSON is corrupt or the file isn't a valid DB. Regenerate it with GenerateDB.
- Every result fails to open → the base path is wrong or the images moved. Fix the path field, or use EditDB's replace method to re-point stored paths.
- Chained DBs give nonsense → the databases were built with different CLIP vision models. Same model, always, or the whole "multi-database" feature is a trap.
It's the least glamorous node in the pack and also the one you can't skip. Spend two minutes getting the base path right and you'll never think about it again.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| db_name | COMBO | 0 options: | |
| path_to_images_folder | STRING | /path/to/folder/with/images | Basepath to the folder containing the images |
| img_dbopt | LoadDB | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMG_DB | LoadDB | — |