Nodes/Eric/Load Embedding Model
ComfyUI Node

Load Embedding Model

The one node every Semantic-Search workflow starts with

By EricRollei·Created 7 months ago·Updated 7 months ago· 2
Load Embedding Model
    • model
    model_nameQwen3-VL-Embedding-8B
    deviceauto
    max_resolution1024x1024 (1MP)
    attention_typesdpa
    embedding_dimFull (4096/2048)

    Every workflow in Eric's Semantic Search starts at the same place: Load Embedding Model. It's the node that loads the Qwen3-VL model from Alibaba that turns your images and your search text into numbers - dense vectors, to be precise. Everything downstream - indexing a folder, searching by text, searching by image - needs those numbers, so this is the one node you genuinely cannot skip.

    A quick vocabulary detour, because "embedding" means two different things in this hobby. The .pt and .safetensors textual-inversion embeddings people used to stack in their negative prompts are tiny trigger-token files that steer a diffusion text encoder. That's not this. What this node loads is an embedding model: a vision-language network fine-tuned to map any image or sentence into a fixed-length vector such that similar things land close together. The pack then compares those vectors with FAISS to find matches. Different concept, same confusing name.

    What you actually set

    The node's dropdowns are where beginners either get it right or fight the pack for an hour. The ones that matter:

    • model_name - Qwen3-VL-Embedding-8B (default) or the 2B. The 8B is more accurate and spits out 4096-dim vectors; the 2B gives you 2048-dim and needs far less VRAM. If you're on a 12GB card, start with the 2B.
    • max_resolution - how big the image is fed to the encoder. Default 1024x1024 (1MP) is the sane middle; 256x256 is thumbnail-fast, 1536x1536 is the accuracy overkill option. This is the single biggest speed/quality lever in the whole pack.
    • embedding_dim - Matryoshka dimension reduction. Full (4096/2048) uses the model's native size; dropping to 1024/512/256 makes smaller, faster indexes at a small accuracy cost. Whatever you pick here must match the index's embedding_dim or every search errors out.

    device (default auto) and attention_type (sdpa, eager, or sage if you installed SageAttention) you can usually leave alone - sdpa is fine and the README explicitly warns FlashAttention-2 doesn't work on Blackwell (sm120) cards.

    Install

    The pack is EricRollei/Semantic-Search, titled "Eric" in ComfyUI Manager - search "Semantic-Search" and hit Install, or clone by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EricRollei/Semantic-Search
    

    Then install the Python deps into your ComfyUI environment (faiss-cpu, qwen-vl-utils, Pillow, numpy; torch and transformers come with ComfyUI) and restart. The gotcha nobody sees coming: the models are not auto-downloaded. The code resolves Qwen3-VL-Embedding-8B from core/config.py's MODELS_PATH (default H:/semantic_search/models), and if it's not there it raises a FileNotFoundError that prints the exact huggingface-cli command to run. Budget ~10–20GB per model and an awkward first download before anything works.

    Where people get burned

    • "Model not found" at load - you haven't downloaded it. Run the huggingface-cli download command the error prints, pointing --local-dir at your configured models path.
    • Dimension mismatch on search - the index was created with a different embedding_dim than this model outputs. Recreate the index with matching dims.
    • CUDA out of memory - drop to the 2B, lower max_resolution, or reduce batch_size in the indexing nodes.
    • Indexing feels like molasses - the pack's own README calls out a PyTorch 2.9.x 3D-convolution performance regression; if you're below 2.10, upgrading is the fix, not your hardware.

    It's a heavy first node - minutes to load an 8B model the first time - but it's the foundation the rest of the pack stands on. Get the dims matched and the model downloaded once, and every search node downstream just works.

    CategoryEric/SemanticSearch

    Inputs (5)

    NameTypeDefaultDescription
    model_nameCOMBOQwen3-VL-Embedding-8B2 options: Qwen3-VL-Embedding-2B, Qwen3-VL-Embedding-8B
    deviceCOMBOauto5 options: auto, cuda, cuda:0, cuda:1, cpu
    max_resolutionoptCOMBO1024x1024 (1MP)Maximum image resolution for encoding. Higher = more accurate but slower.
    attention_typeoptCOMBOsdpaAttention implementation. sdpa=default, eager=fallback, sage=SageAttention (if installed)
    embedding_dimoptCOMBOFull (4096/2048)Embedding dimension. Full=native (4096 for 8B, 2048 for 2B). Reduced dims use Matryoshka representation for smaller/faster indexes.

    Outputs (1)

    NameTypeDescription
    modelEMBEDDING_MODEL