Nodes/IG-Motion-Search/πŸ‚ IG Motion Video Search
ComfyUI Node

πŸ‚ IG Motion Video Search

Search 100,000 videos by how they move β€” no API key

By IDGallagherΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 15
πŸ‚ IG Motion Video Search
  • image
  • url_1
  • url_2
  • url_3
  • url_4
  • url_5
  • status
β—„starting_rank1β–Ί

IG Motion Video Search is a "reverse image search" where the image isn't the subject - it's the movement. Feed it one picture and it queries a prebuilt index of roughly 100,000 real videos, then hands you five URLs to clips whose motion matches. The name is a lie in the best way: it calls no API and needs no key. The whole thing runs locally once it's downloaded its data.

It's the payoff node of the IG-Motion-Search pack, and the author (IDGallagher, who also made the ComfyUI-IG-Motion-I2V motion-controllable video node) has a consistent obsession here: motion as a first-class signal. Where I2V lets you describe motion with a mask or a prompt, this node lets you find it - you have a clip with a gesture or a camera move you like, and you want real footage that does the same thing.

How it works

First use is the heavy part. The node downloads a FAISS index (index.faiss) and a SQLite database of video URLs (data.sqlite) from the author's HuggingFace repo (iggy101/MotionVideoSearch), then loads a DINOv2 ViT-B/14-reg model through torch.hub. From there it's textbook vector search:

  1. Your query image gets embedded into 768-dimensional DINOv2 space (the code pads the image to multiples of 14 for the ViT patch grid first).
  2. FAISS returns the nearest neighbors, with the count set to starting_rank + 4 so it can slice out exactly five.
  3. Each index ID is looked up in SQLite to recover the video's URL.

Two inputs, six outputs, that's it. image (IMAGE) takes the colored motion frame from the pack's other node - this is critical, see below. starting_rank (INT, default 1) is your paging control: 1 gives results 1–5, set 6 to get 6–10, and so on. The outputs url_1 through url_5 are the matches as strings, and status is one line per rank with the FAISS distance - which doubles as the error channel when the index is empty ("No embeddings found in the FAISS index."). The shipped workflow dumps the URLs into a ShowText|pysssss node.

Installing it

ComfyUI Manager: search "IG-Motion-Search" (registry name "Motion-Video-Search"). Or:

cd ComfyUI/custom_nodes
git clone https://github.com/IDGallagher/MotionVideoSearch

Restart ComfyUI. The real install cost isn't the clone - it's the auto-download on first search: the FAISS index plus SQLite metadata plus the DINOv2 weights, a few gigabytes from HuggingFace. First search will look frozen while it pulls those. The README's heavy dependency list (ffmpeg 6, av, mediapy, typer) only matters if you want to build your own index with main.py store; the node itself just needs faiss-cpu, einshape, and timm on top of what ComfyUI already ships.

Where people get burned

  • Feed it the right image. The index was built on color-coded motion frames from the pack's other node, not on regular footage. A normal screenshot will return nonsense every time. The loop is: video β†’ IG Motion Video Frame β†’ colored motion image β†’ this node.
  • First search hanging? It's downloading the index, DB, and DINOv2. Watch the console for progress.
  • Only the first image in a batch is used - it logs a warning, but if you're batching queries, this node is single-shot per run.
  • "OMP: Error #15" on startup is the classic OpenMP duplicate-library crash; the source sets KMP_DUPLICATE_LIB_OK=TRUE precisely to paper over it. If faiss itself fails to import, check that faiss-cpu actually installed into ComfyUI's Python.
  • The distances in status are only meaningful relative to each other. Rank order is the signal; the raw numbers aren't.

Honest take: this is a curiosity, not a product. There's essentially no community discussion about it (zero reddit footprint, zero impressions here), and the ~100k-video index is a one-time snapshot from the author's own ingestion run - don't expect it to grow or get maintained. But as an idea it's great: one afternoon, a few gigabytes, and you're searching real footage by pure motion. That's worth a download.

CategoryπŸ“ IG Motion Search Nodes

Inputs (2)

NameTypeDefaultDescription
imageIMAGEβ€”
starting_rankINT11–9999999β€”

Outputs (6)

NameTypeDescription
url_1STRINGβ€”
url_2STRINGβ€”
url_3STRINGβ€”
url_4STRINGβ€”
url_5STRINGβ€”
statusSTRINGβ€”