Remove Folder from Index
Take a folder back out of search without touching your files
- index
- index
- status
The smallest node in the pack, and one of the more useful ones once your library gets big. Remove Folder from Index does exactly what the name says: given an index and a folder path, it deletes every entry in that index whose file lives under that folder. Your actual image files are untouched - this only removes them from search. If you've ever wanted to un-index that one client's shoot without nuking the whole library, this is the tool.
The mechanism matters for what happens next. The pack tracks which folders it indexed, so this node can delete the database records and thumbnails for everything under the path. But FAISS doesn't support true vector deletion, so the vectors stay behind in the index file as orphans. That's not a bug - it's why the pack ships Compact Index: after a big removal, Get Index Info will report wasted space, and compacting rebuilds the FAISS file without the dead vectors. In practice: remove folders freely, compact occasionally, and the index stays tidy.
Inputs and outputs
Two required inputs - index (the SEMANTIC_INDEX) and folder_path - and no optional knobs, which is refreshing. It returns the index (so you can chain further operations) and a status STRING reporting how many entries were removed, e.g. Removed 1420 images from index.
Install
Same pack story as every node here: ComfyUI Manager (search "Semantic-Search") or
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Semantic-Search
pip install faiss-cpu "qwen-vl-utils>=0.0.8" transformers accelerate pillow
then restart and find the nodes under Eric/SemanticSearch.
Where people get burned
- Path matching is literal. Give it
C:/Photos/Shootand entries underC:/Photos/Shoot/rawmatch too (it's a path-prefix removal), but a trailing-slash or case difference can miss everything. If the status saysRemoved 0, the path didn't match what was indexed - feed it the same path style you used in Add Folder to Index. - Index grows anyway. Right after a removal, search still works and the removed files are gone from results, but the FAISS file keeps the dead vectors until you compact. Don't be alarmed by
deleted_vectorsin Get Index Info - that's the normal state, and it's what Compact Index exists for. - Wrong index, wrong everything.
Remove Folder from Indexacts on whateverSEMANTIC_INDEXyou feed it. If you've got several libraries, double-check you wired the right one - a remove on the wrong index is annoying to reverse (though not destructive to your files, since nothing here deletes media).
It's a boring, honest utility node, and that's fine. The pack's real job is keeping search instant over a growing library, and "un-index this folder" is a core part of that - this is the only node that does it without forcing you to rebuild from scratch.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| index | SEMANTIC_INDEX | — | |
| folder_path | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| index | SEMANTIC_INDEX | — |
| status | STRING | — |