LLM_Embed
Turn text into a vector of numbers — the pack's odd one out
- LLM
- FLOAT
Here's the strange one in the pack. Every other node here is about generating text. LLM_Embed doesn't generate text at all - it converts a string into a list of floats: the model's embedding of that text. Same role as the CLIP encoder in a diffusion pipeline, just for raw text instead of prompts. If you've ever thought "what if I could measure how similar two strings are, numerically," this is the node that makes it possible inside a ComfyUI graph.
The mechanism is standard embedding stuff: you feed the model a string, and out the other side comes a dense vector (hundreds or thousands of numbers, depending on the model) that encodes its meaning. The useful properties fall out of that: similar texts land near each other in the vector space, and you can compute similarity as a distance. It's the same math that powers semantic search and RAG-style retrieval everywhere else.
Inputs and output
- LLM - the loaded model. There's a caveat coming about this, keep reading.
- input_str - the text to embed, a multiline string. That's the whole input list.
The output is FLOAT, and it's a list - the embedding vector itself.
The caveat you need to know
The pack's README lists "Create Embedding method is disabled" under known issues. That's the author telling you that llama-cpp-python's embedding generation path isn't wired up in the pack's main API. And yet here's a node literally named LLM_Embed. The tension is real: whether this node actually produces a meaningful embedding depends on the model being loaded for embedding. llama.cpp only emits proper embeddings when the model is initialized in embedding mode (the embedding flag you'll find on Load LLM Model Advanced). If the model wasn't loaded that way, what comes out can be garbage - or an error - rather than a useful vector.
So the practical recipe is: load the model through Load LLM Model Advanced with embedding set to true, then feed it here. An embedding-oriented GGUF (any of the embedding-tuned small models on HuggingFace) helps a lot too. This is the one node in the pack where the surrounding setup matters as much as the node itself.
Where you'd use it
The classic uses: semantic similarity (compare two captions), deduplication (are these two generated prompts basically the same?), or clustering a batch of texts. In a ComfyUI graph, that vector is still a list of floats - wiring it into a custom script or another node that does cosine similarity is on you; nothing in this pack consumes embeddings. It's a building block with no second half included.
Install
Shared pack steps: ComfyUI Manager search "ComfyUI-Llama", or:
cd ComfyUI/custom_nodes
git clone https://github.com/daniel-lewis-ab/ComfyUI-Llama
plus pip install llama-cpp-python on manual installs. GGUF models go in ComfyUI/custom_nodes/ComfyUI-Llama/models, restart, Ctrl+F5, and everything is under the LLM menu.
Honest verdict: LLM_Embed is the pack's least-finished surface, and the embedding-mode requirement makes it easy to produce silent nonsense. But if you specifically need semantic vectors in a graph without pulling in a separate embedding service, it's the only option here - and the correct wiring (embedding-mode loader + embedding model) does work. Set expectations, and it'll behave.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| LLM | LLM | — | |
| input_stropt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |