Nodes/Eric/Search by Text
ComfyUI Node

Search by Text

Find any photo by describing it — no tags, no filenames

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

This is the node the whole pack exists for. Search by Text takes a natural-language query like "woman in a red dress standing by the ocean at sunset" and returns every indexed image, video, or PDF page that matches it - no manual tagging, no filename guessing, no folder archaeology. If you've ever stared at 30,000 photos and wanted to just describe the one you're looking for, this is the payoff for all that indexing.

How it works

Search by Text is stage one of the pack's two-stage retrieval. The query sentence goes through your EMBEDDING_MODEL and comes out as a vector; FAISS then finds the index vectors closest to it (cosine similarity on normalized vectors, which is what the 0–1 scores are). Because Qwen3-VL is a vision-language model, the query and the images live in the same vector space - the model was fine-tuned to put "red dress, ocean, sunset" near images that actually show those things. The top top_k candidates come back as a SEARCH_RESULTS object carrying file paths, scores, and thumbnails.

The scores are the useful bit. They're similarity values in roughly 0–1, and they're honest: a search for "sunset over mountains" will return scores from ~0.7 down to ~0.2, and the drop-off tells you where the good matches end. That's what makes min_score meaningful.

The inputs that matter

  • query - the description. Be concrete and visual ("dramatic portrait with rim lighting") rather than abstract; the model matches content, not vibes.
  • top_k (default 50) - how many candidates stage one pulls. If you're planning to rerank, ask for more here (50–100) and let the reranker trim.
  • min_score (default 0) - a floor on similarity. Start at 0 and raise it only when noise is creeping in; 0.15–0.3 is a reasonable band for photos.
  • result_type - filter to images, videos, documents, or media (images+videos). Handy when your index mixes everything.
  • instruction - an optional custom instruction for the embedding model (e.g. "Find similar invoices"), which can nudge retrieval semantics.

Required: index, model, query. Output: results (SEARCH_RESULTS).

Install

Pack install as usual - ComfyUI Manager (search "Semantic-Search") or git clone https://github.com/EricRollei/Semantic-Search into custom_nodes, install the requirements.txt deps, restart, find it under Eric/SemanticSearch. No API keys, no cloud - everything runs locally on your GPU.

Where people get burned

  • Empty results with a valid index. Usually one of two things: a dimension mismatch between model and index (check both are 4096 for the 8B model), or your query got filtered out by a min_score you set too high. Zero the floor and see what's actually being returned.
  • Search quality is meh. First check your indexing resolution - an index built at 256x256 thumbnails can't encode fine detail. Re-index at 1024 with the 8B model before blaming the query. Then rephrase: the model rewards concrete, visual language.
  • "This isn't a magic search box." Semantic search finds images whose content matches, but it doesn't understand negative phrasing ("not the beach one") and it can't filter on metadata. That's what Search with Exclusion and the other search nodes are for.

When it's working, it's quietly startling - type a sentence, get the exact shoot back out of a six-figure library. That's the whole reason anyone installs this pack.

CategoryEric/SemanticSearch

Inputs (7)

NameTypeDefaultDescription
indexSEMANTIC_INDEX
modelEMBEDDING_MODEL
querySTRING
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)
instructionoptSTRINGCustom instruction for the embedding model

Outputs (1)

NameTypeDescription
resultsSEARCH_RESULTS