image-feature-extraction Β· vision + language Β· WASM Β· ~236 MB
Two aligned models project pictures and words into the same 768-number space, so a phrase
and an image become comparable. Type a dog and the dog photo rises to the top; click an
image and find the ones most like it. CLIP-style cross-modal search β from the Nomic family β with
real embeddings you can see, all on your device.
| Models | nomic-ai/nomic-embed-vision-v1.5 (image) + nomic-ai/nomic-embed-text-v1.5 (text) |
|---|---|
| Task / pipeline | image-feature-extraction + text feature-extraction, one shared space |
| Architecture | ViT image tower + nomic-BERT text tower, aligned (Nomic Embed multimodal) |
| Output | 768-d embedding per image / per text, L2-normalised (cosine = dot product) |
| Quantization | q8 (8-bit) ONNX, both towers |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~236 MB total (~96 MB vision + ~140 MB text), cached after first load |
| License | Apache-2.0 (Nomic AI) |
| Web APIs | WebAssembly, Web Workers, Canvas, FileReader β all Baseline widely available |
When the models load, the gallery is embedded once. Then search it two ways: type a phrase (text β image), or pick a photo to find look-alikes (image β image). Everything is on-device.
Click a gallery photo below to use it as the query β the others re-rank by visual similarity.
Gallery
Gallery images via Wikimedia Commons β see references for full attribution.
Every image and every phrase becomes one 768-number vector, unit-normalised so its length is 1. Similarity is the cosine β here a plain dot product β between the query vector and each image vector. Below is the query's vector as a colour fingerprint (warm = positive, blue = negative), then the exact cosine to each gallery image. Same gallery, different phrase β different ranking. That is the whole trick, and it is cross-modal: text and image share one space.
Query embedding (768-d fingerprint)
| Image | cosine | rank |
|---|
A shared imageβtext space turns "search" into "compare vectors." No fixed tags, no per-image API call β you embed once, then rank by meaning, in the browser, for free.
Type a phrase and watch the gallery re-rank by meaning β feel cross-modal search first-hand.
Zero-shot image tagging: score any image against label phrases you type, no training.
Embedding explorer: see the whole gallery arranged by similarity to whatever you pick.
Search β caption: retrieve the best image for a phrase, then ViT-GPT2 describes it.
Both towers load with the low-level Transformers.js classes and share a 768-d space:
import { AutoModel, AutoProcessor, AutoTokenizer, RawImage } from "@huggingface/transformers";
const proc = await AutoProcessor.from_pretrained("nomic-ai/nomic-embed-vision-v1.5");
const vis = await AutoModel.from_pretrained("nomic-ai/nomic-embed-vision-v1.5", { dtype: "q8" });
const tok = await AutoTokenizer.from_pretrained("nomic-ai/nomic-embed-text-v1.5");
const txt = await AutoModel.from_pretrained("nomic-ai/nomic-embed-text-v1.5", { dtype: "q8" });
// image β 768-d (CLS token of last_hidden_state)
const img = await (await vis(await proc(await RawImage.read(url)))).last_hidden_state;
// text β 768-d (mean-pooled), prefixed "search_query: " for queries
const q = await txt(tok("search_query: a dog", { padding: true }));
// cosine of the L2-normalised vectors = similarity
This page runs both towers in a Web Worker and L2-normalises every vector there, so ranking the gallery on the main thread is a handful of dot products. Nothing is uploaded.
Gallery images (all via Wikimedia Commons): person β Jones, W. A. (Public domain); dog β Tudor Washington Collins (CC BY 4.0); citrus β Scott Bauer, USDA (Public domain); mountains β KennyOMG (CC BY-SA 3.0); night city β King of Hearts (CC BY-SA 3.0); bicycle β Ingolfson (Public domain); market β Francisco Anzola (CC BY 3.0); glass β steven powell (CC BY 2.0).