Embedding Detokenizer Analysis
Find out what's actually inside that .pt embedding you downloaded
- clip
- analysis
- approximation
- cwb_approximation
Negative embeddings are dead as a practice, the KB's prompt-engineering essay says - but positive embeddings never went away, and every ComfyUI user has at some point downloaded a mysterious .pt embedding, typed its name into a prompt, and wondered what it actually does. This node is the X-ray machine for that question: it loads any embedding from your embeddings directory and runs it against the connected text encoder's vocabulary to tell you which words the vector is closest to.
The mechanism is straightforward and useful: the embedding is a vector, and the encoder has a vocabulary of token embeddings. This node computes how similar the embedding is to each token's vector across every compatible branch of the connected clip's tokenizer, ranks them, and reports the top matches. Pick your embedding from the embedding_name dropdown (it reads ComfyUI's embeddings folder), set top_k (default 5) for how many matching words to show per embedding, and alignment_candidates (default 64) for how many candidate words it considers before ranking. similarity_metric lets you switch between cosine, euclidean, and dot_product - cosine is the sensible default and the one you'll leave alone. The latin_only toggle filters results to Latin text and common punctuation, which is there because some vocabularies' top matches are CJK or script tokens that mean nothing to you.
Outputs: analysis is the readable breakdown, and then there are two approximation strings - approximation and cwb_approximation - which are the pack's attempts to reconstruct plain-text approximations of the embedding (the second via its CWB-style blending math). These are the "so what does this thing boil down to in words" answers, and honestly the most useful part for the beginner: instead of reading a vector, you get the words it points at.
Where this earns its keep: checking whether an embedding you downloaded is actually safe and intended - the classic community story is an "embedding" that's secretly a LoRA-shaped surprise or just garbage vectors, and this tells you in seconds whether the nearest words match the name on the tin. It's also the diagnostic companion to the pack's embedding-export pipeline: if you exported blended visual embeddings, this is how you check what the export actually encoded. If analysis comes back with matches that have nothing to do with the embedding's name, that's your signal to be suspicious.
The practical caveat is the clip you connect: results are only as meaningful as the encoder's vocabulary, so connect the same text encoder you'd actually use the embedding with - match qwen3vl_32b to a Qwen-based model's encoder, CLIP-L to an SDXL chain. A mismatch isn't an error, it just produces misleading nearest-words.
Install is pack-standard: Manager search "ComfyUI-UtilsCollection" or git clone into custom_nodes. No model downloads; the only requirement is that your embeddings live in ComfyUI's standard embeddings folder where the dropdown can see them. Debugging tool, not a generation tool - and a genuinely useful one.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| embedding_name | COMBO | Select an embedding from ComfyUI's embeddings directory. | |
| top_k | INT | 51–100 | How many matching words to show for each embedding. |
| similarity_metric | COMBO | cosine | 3 options: cosine, euclidean, dot_product |
| alignment_candidates | INT | 648–512 | How many possible word matches to consider for each embedding. |
| latin_only | BOOLEAN | false | Show only Latin text and common punctuation in word matches. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| analysis | STRING | — |
| approximation | STRING | — |
| cwb_approximation | STRING | — |