Search by Video
Find clips like this clip, without watching your whole library
- index
- model
- results
Video is where a raw filename-and-folder search dies completely - no one names clips usefully, and you can't eyeball 40 hours of footage. Search by Video is the pack's answer: point it at a reference video file and it finds indexed videos that look like it. It's the video analogue of Search by Image, and it only works because the pack already indexed your clips by sampling frames during Add Folder to Index.
How it works
Video isn't a single embedding - it's many frames. When you index a video, the pack samples it (roughly 2 fps, capped) and embeds the extracted frames; the same idea applies here to the query. max_frames (default 32) controls how many frames get pulled from your reference clip, each is embedded, and the results are ranked by how closely the query frames match the indexed content. More frames = a more faithful representation of the clip, at the cost of a slower search. Videos indexed at the pack's default 512x512 frame cap are compared against query frames at the same scale, which keeps memory sane while still capturing motion and scene content.
One honest limitation: this is content similarity, not scene-cut or shot-level search. A clip of a beach at sunset matches other beach-at-sunset clips; it doesn't segment your footage into scenes or match exact camera moves.
Inputs
Required: index, model, video_path (path to your query clip). Optional: top_k (default 50), min_score, result_type, max_frames (4–64, default 32), instruction. Output: results (SEARCH_RESULTS), same object every search node returns, so it feeds Preview Results, Load Result Images, Get Result Paths, or Rerank Results like anything else.
Install
This is the one node whose install has a hidden extra. Pack install is the usual - ComfyUI Manager or git clone https://github.com/EricRollei/Semantic-Search into custom_nodes - but video support depends on opencv-python-headless, which is an optional extra in the pack's pyproject.toml, not in the core requirements.txt. Without it, videos silently don't get indexed or searched:
pip install faiss-cpu "qwen-vl-utils>=0.0.8" transformers accelerate pillow opencv-python-headless
Where people get burned
- Videos never show up in results. Almost always the missing
opencv-python-headlessabove, orinclude_videoswas off when you indexed the folder. Re-index after installing the dep - existing indexes won't retroactively gain videos. - Query on a clip that wasn't indexed the same way. Frames sampled at indexing time and frames sampled now only match if the model's resolution settings match. If search feels consistently off for video, verify the embedding model's
max_resolutionis the same one used when the library was built. - Slow searches with
max_framescranked. 64 frames per query clip means 64 embeddings per search. Keep it near default unless the clip is very long and your matches are bad.
Video search is genuinely the killer feature of this pack - it's the thing Lightroom-style tagging tools never solved. It asks for one extra pip package, and in exchange your clips become searchable by what actually happens in them.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| index | SEMANTIC_INDEX | — | |
| model | EMBEDDING_MODEL | — | |
| video_path | STRING | — | |
| top_kopt | INT | 501–500 | — |
| min_scoreopt | FLOAT | 0.000–1 | Minimum score threshold (0-1). Results below this score are filtered out. |
| result_typeopt | COMBO | all | Filter results by media type: all, images, videos, documents, or media (images+videos) |
| max_framesopt | INT | 324–64 | Maximum number of frames to extract from video for query |
| instructionopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| results | SEARCH_RESULTS | — |