EmbeddingGemma 2 Loader
The node that decides whether the other seven work at all
- model
Most ComfyUI loaders are interchangeable - grab the checkpoint, plug it into the sampler, done. This one isn't. It loads a different kind of model entirely, and if you don't understand what it's loading, none of the seven nodes downstream make sense.
EmbeddingGemma 2 is Google DeepMind's multimodal embedding model. Not a generator. It reads text, images, video and audio and turns each into a 768-number vector, all in one shared space, so you can ask "which of these five captions fits this image best?" and get a number back. That's the whole feature. If you came here expecting "ComfyUI embeddings" - the tiny .pt textual-inversion files you drop into models/embeddings/ and trigger with a word in your prompt - this is nothing to do with those. Different file, different folder, different job.
What it's actually doing
Under the hood it's sentence-transformers: the loader builds a SentenceTransformer pointed at your model folder with local_files_only=True, and every encode node calls its .encode(). That's the exact usage the model card documents, and the pack author went to some trouble to prove it - the README reports bit-identical vectors against a separate reference environment in 18 of 18 cases. Nothing is downloaded at runtime, ever. If a folder isn't on disk, the node fails; it won't quietly fetch anything.
Two details that explain most of the weirdness you'll hit:
There's one resident model, globally. The runtime keeps a single loaded instance keyed by folder + modalities + dtype + device. Load a second combination and the first gets evicted and rebuilt. So if you stick two loaders with different settings in one workflow, you've built a model-loading treadmill without knowing it.
Modalities are load-bearing, not cosmetic. The modalities combo maps to real config overrides: text loads 270M parameters, text + image/video 440M, text + audio 570M, all 740M. Pick text and then try to encode an image and you get a clean ValueError - the model wasn't even built with a vision tower.
The inputs you care about
Five fields, and only two are decisions most people need to think about.
model - a dropdown of folders inside models/embeddinggemma/. The catch: it only lists a directory if all five of config.json, modules.json, model.safetensors, tokenizer.json and processor_config.json are present. A raw HuggingFace snapshot without the sentence-transformers modules.json will exist on disk and still not appear. If the dropdown is empty, that's almost always why.
modalities - default all. Drop it to text + image/video if you're only ranking pictures and want 300M parameters back, or text if you're doing plain text similarity and don't want to pay for towers you'll never touch. Peak on the full model is about 2.5 GiB in bfloat16, so this is a real saving on a smaller card.
dtype - auto is right. It gives you bfloat16 when your GPU supports it and float32 otherwise. There is no float16 option because the model overflows in it; that's per the model card, not an oversight.
device - cuda or cpu. cuda raises immediately if CUDA isn't available rather than half-loading. CPU float32 works and is just slow.
keep_loaded - on by default. Leave it on. Turn it off and the model is freed after every encode node, which is only sane if you're fighting for VRAM mid-workflow - and honestly, that's what the Unload node is for.
You get one output: model, of the pack's custom EG2_MODEL type. It only plugs into the pack's own encode nodes. Nothing else in ComfyUI takes it.
Install
ComfyUI Manager: search EmbeddingGemma 2 for ComfyUI and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/hiroki-abe-58/ComfyUI-EmbeddingGemma2
python -m pip install -r ComfyUI-EmbeddingGemma2/requirements.txt
python ComfyUI-EmbeddingGemma2/tools/download_model.py --models-dir ../models/embeddinggemma
That last line pulls about 1.5 GB from google/embeddinggemma-2 at a pinned revision and SHA-256 checks every file. Then restart.
Where people get burned
Three of them, in order of frequency.
Your ComfyUI is too old. The pack is written against the V3 backend authoring API (from comfy_api.latest import io) - there's no NODE_CLASS_MAPPINGS anywhere in it. On a ComfyUI older than roughly v0.38 the nodes simply won't register, and it looks like a broken install rather than a version mismatch. If the pack folder is there and the nodes aren't, update ComfyUI before you debug anything else.
The dependency swap. sentence-transformers 6.1.0 needs huggingface-hub<2.0, so installing the requirements into a fresh ComfyUI environment downgrades huggingface-hub from 2.2.0 to 1.33.0. ComfyUI itself ran fine on it in the author's testing, but if another custom node of yours insists on hub 2.x, you've just found your conflict. That's the normal ComfyUI story - everything shares one Python environment - not something specific to this pack.
An empty model dropdown. python tools/download_model.py --verify-only --models-dir models/embeddinggemma names the missing file, which beats guessing.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | A model folder in models/embeddinggemma (e.g. embeddinggemma-2) | |
| modalities | COMBO | all | Encoders to load. text = 270M parameters, + image/video 440M, + audio 570M, all 740M. |
| dtype | COMBO | auto | auto = bfloat16 on a GPU that supports it, otherwise float32. float16 is not offered: the model overflows in float16 (model card). |
| device | COMBO | cuda | 2 options: cuda, cpu |
| keep_loaded | BOOLEAN | true | Keep the model in memory after each encode node. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | EG2_MODEL | — |