Nodes/kinamix-embeddings-comfyui/Load Kinamix Embedding
ComfyUI Node

Load Kinamix Embedding

The boring front door of the Kinamix pack — and that's a good thing

By latentwill·Created 5 months ago·Updated 4 months ago· 0
Load Kinamix Embedding
    • embedding
    embedding_file
    embedding_file_override

    Every other node in this pack consumes a KINAMIX_EMBEDDING, and this is the node that makes one. Load Kinamix Embedding reads a trained concept file out of ComfyUI/models/embeddings/ and hands it to Apply Embedding Qwen, DFG, Concept Bias, or Multi Embedding. There's nothing to tune here - no strength, no curve, no cleverness. It just opens the file. For a pack about applying learned concepts, the loader being this boring is a feature, not a gap.

    Here's the context you need: a Kinamix embedding is a small block of learned tokens trained by the kinamix-embeddings-qwen repo using DSCI (DiT-Side Concept Injection). For Qwen-Image - the 20B MMDiT whose Qwen2.5-VL text encoder emits a long token stream - a concept is a file like 8 × 3584, about 56 KB. The loader's whole job is to read those tokens plus the metadata that says what encoder they were trained for, and wrap them in a single KINAMIX_EMBEDDING object the apply nodes understand.

    How it works

    Under the hood it's load_embedding() plus a ComfyUI folder scan. It lists everything in models/embeddings/ into a dropdown, reads the file, and returns a dict holding the token tensor, the training method (dsci), the encoder name from the file's metadata, and the hidden dim. Two file formats are supported:

    • .safetensors - the recommended one. Safe by construction (no code execution) and carries metadata the node actually uses, like the encoder name.
    • .pt - legacy torch.save format, kept for backward compatibility. It's rejected unless the file's method is dsci.

    The inputs and output

    • embedding_file - a dropdown listing every file in models/embeddings/. This is the only required input, and it's the one you'll use 99% of the time.
    • embedding_file_override (optional) - a string input, set up so an upstream node can drive file selection. Handy if you're swapping embeddings programmatically rather than by hand.
    • Output: embedding - wire it into the embedding socket of any of the four apply nodes.

    One quirk: if your models/embeddings/ folder is empty, the dropdown shows a single "none" option and the node raises "No embedding files found in models/embeddings/". That's not a bug, it's a nudge - the file has to physically be in that folder (or one ComfyUI scans for embeddings) before the node will ever see it.

    Installing it

    Standard for the pack - no heavy dependencies, just torch:

    cd ComfyUI/custom_nodes
    git clone https://github.com/latentwill/kinamix-embeddings-comfyui.git
    

    Restart ComfyUI, then drop your trained .safetensors into ComfyUI/models/embeddings/. Or use ComfyUI Manager and search kinamix-embeddings-comfyui.

    Where it bites

    The loader doesn't check that your embedding matches the model in your graph - it can't, because it has no idea what CLIP you loaded. The dim mismatch error surfaces downstream in the apply node, not here, so don't be confused when a file "loads fine" and then fails a step later. And the file has to be a genuine Kinamix/DSCI export. If you drop a classic SD 1.5 or SDXL textual inversion in here, it may read without complaint, but it targets a CLIP vocabulary Qwen's encoder doesn't have - that 768-dim file has nothing to bind to, and the apply node's dim check will catch it. This is the same "embeddings die when the encoder changes" problem that killed the old embedding libraries, just in reverse: the pack is built for the new encoder, not the old ones.

    CategoryKinamix/Embeddings

    Inputs (2)

    NameTypeDefaultDescription
    embedding_fileCOMBO1 options: none
    embedding_file_overrideoptSTRING

    Outputs (1)

    NameTypeDescription
    embeddingKINAMIX_EMBEDDING