Load Reranker Model
The second, sharper brain behind two-stage search
- model
If Search by Text and the other search nodes are the sprint, Load Reranker Model is the judge. It's the second stage of Eric's two-stage retrieval pipeline: the embedding model finds a hundred promising candidates in milliseconds, and the reranker - a separate, heavier Qwen3-VL model - reads the query and each candidate thumbnail together and decides which of those hundred actually deserve the top spots.
The important thing to know up front: you don't need this node for basic search to work. The pack runs completely fine on embedding + FAISS alone. You add the reranker only when you're chasing precision - near-duplicate-lookalike libraries, big indexes where stage one's rough ranking just isn't cutting it, or when you want to filter on a reranker score that's stricter than the raw cosine similarity. It's an upgrade path, not a requirement.
How it works
Stage one computes a query vector and does an approximate nearest-neighbor scan with FAISS. That's fast but shallow - it compares one number per image. The reranker instead runs cross-attention between the query text and each candidate image's actual pixels, which is a much richer comparison and consequently much slower (the README's ballpark: thousands of candidates a second for stage one, tens per second for stage two). That's the whole reason the pipeline is two stages instead of one - you don't want the expensive model looking at all three hundred thousand images, just the fifty that already made the cut.
Inputs and output
- model_name -
Qwen3-VL-Reranker-8B(default) or the 2B. Another multi-gigabyte download either way; the 2B is the sensible pick on 12GB cards. - device -
autois fine; explicitcuda:0/cuda:1if you're juggling GPUs. - max_resolution - defaults to
512x512and the tooltip explains why: reranking works off thumbnails, so you don't need full-res images. Leave it low, it's not a mistake. - attention_type - same
sdpa/eager/sagechoice as the embedding model; sdpa is the safe default.
The output is a RERANKER_MODEL handle, and its only consumer is Rerank Results, which you wire between a search node and your output nodes. Nothing else in the pack accepts it.
Install and gotchas
Same pack install as the rest - ComfyUI Manager ("Eric" / Semantic-Search) or a git clone into custom_nodes, plus faiss-cpu, qwen-vl-utils, transformers, accelerate, Pillow. The reranker model is another one of those "downloads from HuggingFace into your configured models path, and the node errors with the exact command if you haven't" situations - see the Load Embedding Model notes; same mechanism, bigger disk bill (roughly 10–20GB per model).
Realistically, the traps here are memory and time. Loading an 8B reranker on top of an 8B embedding model can push a 16GB card into OOM before you've searched anything. If you hit it, drop the reranker to the 2B or skip it entirely - plenty of workflows run happily single-stage. And don't expect magic: reranking sharpens the order and can rescue a couple of buried matches, but if your index was built at 256x256 thumbnails, no reranker is going to find detail that was never encoded.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | Qwen3-VL-Reranker-8B | 2 options: Qwen3-VL-Reranker-2B, Qwen3-VL-Reranker-8B |
| device | COMBO | auto | 5 options: auto, cuda, cuda:0, cuda:1, cpu |
| max_resolutionopt | COMBO | 512x512 | Maximum image resolution for reranking. Lower is faster since reranking uses thumbnails. |
| attention_typeopt | COMBO | sdpa | Attention implementation. sdpa=default, eager=fallback, sage=SageAttention (if installed) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | RERANKER_MODEL | — |