Nodes/ComfyUI Griptape Nodes/Griptape Embedding Driver: HuggingFace
ComfyUI Node

Griptape Embedding Driver: HuggingFace

Embeddings straight from the Hub's serverless inference

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Embedding Driver: HuggingFace
    • DRIVER
    embedding_modelsentence-transformers/all-MiniLM-L6-v2
    tokenizersentence-transformers/all-MiniLM-L6-v2
    max_output_tokens512
    api_token_env_varHUGGINGFACE_HUB_ACCESS_TOKEN

    Most embedding drivers in this pack point at one company's API. Griptape Embedding Driver: HuggingFace is the free-range option: it runs embeddings through Hugging Face's serverless inference, which means you can point it at any embedding model on the Hub that supports inference - starting from the default sentence-transformers/all-MiniLM-L6-v2, a small, fast model that's a sensible default for everyday RAG.

    This is the driver to try when you want model variety without deploying anything. Swap the model name, and you're testing a different embedding approach with no endpoint to manage.

    How it works

    Configuration node, pack-standard shape: it produces an EMBEDDING_DRIVER that downstream RAG/vector-store nodes use to convert text into vectors. The inference happens on Hugging Face's side, on demand.

    The inputs:

    • embedding_model - the model ID on the Hub, default sentence-transformers/all-MiniLM-L6-v2. This is the field you'll actually change.
    • tokenizer - which tokenizer to use with it, defaulting to the same model ID. You almost never need to touch this; change it only if you know the model needs a distinct tokenizer.
    • max_output_tokens - cap on output tokens, default 512. Lower it to cut cost/latency on long inputs.
    • api_token_env_var - env-var name for HUGGINGFACE_HUB_ACCESS_TOKEN, not the literal token. The README points at huggingface.co/settings/tokens. Some free/public models work without a token, but rate limits are much friendlier with one.

    The important constraint, straight from the README: Hugging Face's serverless inference only serves models under ~10GB, and not every model on the Hub supports it. If you pick a big or unsupported model, the call fails - that's a Hub limitation, not the node's.

    Installing

    Ships in the ComfyUI Griptape Nodes pack:

    • ComfyUI Manager: search "Griptape" → install ComfyUI-Griptape.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/griptape-ai/ComfyUI-Griptape, then restart.

    Pack dependencies: griptape[all], openai, python-dotenv, plus git-hosted extensions. The torch caveat applies pack-wide (reinstall torch with the CUDA index if Griptape's install conflicts with ComfyUI's build - README troubleshooting).

    Gotchas

    Serverless inference is a shared queue: cold starts and rate limits are real, so a "slow" driver is often just the Hub being busy. If a model ID doesn't work, don't assume the node is broken - check that the model supports inference and is under the size limit. And be deliberate with max_output_tokens; all-MiniLM's default embedding is 384 dimensions, and raising the cap doesn't make a fixed-dimension model richer, it just spends tokens.

    CategoryGriptape/Agent Drivers/Embedding

    Inputs (4)

    NameTypeDefaultDescription
    embedding_modeloptSTRINGsentence-transformers/all-MiniLM-L6-v2The model to use for embeddings.
    tokenizeroptSTRINGsentence-transformers/all-MiniLM-L6-v2The tokenizer to use with the model.
    max_output_tokensoptINT512The maximum number of tokens for the output.
    api_token_env_varoptSTRINGHUGGINGFACE_HUB_ACCESS_TOKENEnvironment variable for the API token. Do not use your actual API key here.

    Outputs (1)

    NameTypeDescription
    DRIVEREMBEDDING_DRIVER