Nodes/Eric/Search by Video
ComfyUI Node

Search by Video

Find clips like this clip, without watching your whole library

By EricRollei·Created 7 months ago·Updated 7 months ago· 2
Search by Video
  • index
  • model
  • results
video_path
top_k50
min_score0.00
result_typeall
max_frames32
instruction

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-headless above, or include_videos was 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_resolution is the same one used when the library was built.
  • Slow searches with max_frames cranked. 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.

CategoryEric/SemanticSearch

Inputs (8)

NameTypeDefaultDescription
indexSEMANTIC_INDEX
modelEMBEDDING_MODEL
video_pathSTRING
top_koptINT501–500
min_scoreoptFLOAT0.000–1Minimum score threshold (0-1). Results below this score are filtered out.
result_typeoptCOMBOallFilter results by media type: all, images, videos, documents, or media (images+videos)
max_framesoptINT324–64Maximum number of frames to extract from video for query
instructionoptSTRING

Outputs (1)

NameTypeDescription
resultsSEARCH_RESULTS