WordEmbeddings: Local Loader
Point it at a word2vec file you already own
- we_model
Every other loader in this pack pulls a pretrained model from the internet on first use. This one is the exception: it loads embeddings you already have on disk, no download, no account, no network dependency. If you're on a machine that's offline, behind a firewall, or just sick of gensim re-fetching gigabyte files, this is the node you start your workflow with.
It exists because the pack's author clearly knows that gensim.downloader isn't always the answer. Maybe you trained your own vectors, maybe you grabbed a word2vec .bin from an old mirror, maybe you only have a specific domain corpus - whatever the case, the analysis nodes (Equation, Token Axis, Centrality, all the rest) don't care where the WE_MODEL came from. They only need the handle this node hands out.
How it works
Under the hood it's a thin wrapper around gensim's KeyedVectors loaders. The format dropdown tells gensim which loader to use, and auto guesses from the file extension:
.kv/.kv2→KeyedVectors.load(native gensim format, memory-mapped).bin/.bin.gz→ word2vec binary format.txt/.vec/.gz→ word2vec plain-text format
If auto can't decide, it tries native load first, then falls back to text. The label input is just a display prefix baked into the model's name - set it to whatever helps you tell models apart in the node graph.
The inputs that matter
Only three, and one of them is required:
- path (required) - the full path to your embedding file. Quoted paths are handled (surrounding quotes get stripped), but a path that doesn't exist raises a
FileNotFoundErrorright in the node, so double-check it. Relative paths resolve against wherever ComfyUI's working directory is, which is easy to get wrong - just use an absolute path. - format -
auto(default),kv,word2vec_bin, orword2vec_text. Leave it onautounless auto-detection lets you down, which happens with odd extensions or.gzfiles that are actually binary. - label - string prefix for the model name, default
"local".
Output is we_model (WE_MODEL), same wire type as the pretrained Loader, so the two are interchangeable in a workflow.
Installation
Identical to the rest of the pack: ComfyUI Manager, search "ComfyUI-WordEmbeddings," install, restart. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/jtrue/ComfyUI-WordEmbeddings
pip install gensim numpy
Then restart ComfyUI. There's no extra model download for this node - the file on disk is the model. Note the gensim>=4.3.3 requirement: some very old gensim builds don't ship all the KeyedVectors formats this node leans on, so if you're on a legacy environment, upgrade gensim first.
Where people get burned
The number one failure is the path. A trailing space, a tilde that wasn't expanded, a Windows path with backslashes pasted into a field that expects forward slashes - all of these produce the same FileNotFoundError, and it's the most common thing you'll see. The node also memory-maps native .kv files with mmap="r", which is great for big vocabularies but means the file can't be locked or mid-write on Windows when you load it.
One more honest note: the results you get depend entirely on the vectors you load. If your file was trained on a narrow corpus, the "neighbors" and "analogies" you get out are only as good as that corpus. The pack's README says as much - different models give different absolute values and neighbors, so don't compare numbers across models.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| formatopt | COMBO | auto | 4 options: auto, kv, word2vec_bin, word2vec_text |
| labelopt | STRING | local | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| we_model | WE_MODEL | — |