Nodes/ComfyUI-J/🤗 Diffusers Texture Inversion Embedding Loader
ComfyUI Node

🤗 Diffusers Texture Inversion Embedding Loader

Textual inversion, in a pack that spells it wrong

By Jannchie·Created 2 years ago·Updated about a year ago· 98
🤗 Diffusers Texture Inversion Embedding Loader
  • pipeline
  • pipeline
◄texture_inversion▾►

Quick heads up before anything else: the node's own display name says "Texture Inversion," not "Textual Inversion." That's almost certainly just a typo in the pack - the technique itself, and everything this node actually does, is textual inversion. Worth knowing so you don't go searching for a "texture inversion" concept that doesn't exist, or miss this node entirely while searching for "textual."

What it is and how it works

Textual inversion trains a handful of new vectors in a text encoder's embedding space and binds them to a trigger word, without touching the model's actual weights at all - which is why the files are tiny (tens of kilobytes, not megabytes) and why they only work on the exact text encoder they were trained against. This node loads one of those files and attaches it to a pipeline, after which you can use its trigger word in your prompts the same way you'd use any other word.

There's a genuinely good reason this still fully works here, where it's become shaky ground on newer models: textual inversion is locked to whichever text encoder it was trained against, and the CLIP-based text encoders on SD1.5 and SDXL - exactly what this pack targets - are still the architecture family where the technique lives on. The newer LLM-encoded models (the ones that read prompts as instructions rather than tag soup) have nothing a CLIP-trained embedding can bind to, which is part of why textual inversion publishing has fallen off sharply elsewhere in the ecosystem. None of that decline applies to what this node is built for.

The inputs and outputs that matter

  • pipeline (required) - the DIFFUSERS_PIPELINE to attach the embedding to. This has to be the right architecture family for whichever embedding file you're loading - an SD1.5-trained embedding won't mean anything to an SDXL pipeline's text encoder, and vice versa.
  • texture_inversion (required, enum) - the embedding file to load, picked from whatever textual inversion files ComfyUI already knows about.

Output is pipeline (DIFFUSERS_PIPELINE) - the same type that went in, now with the embedding attached. That input-output symmetry tells you exactly where this node belongs in a graph: right after your Diffusers Pipeline (or Diffusers XL Pipeline) loader and before anything that reads prompts, like the Compel embedding node. It's a modifier in the chain, not a separate branch.

Installing it

Part of the ComfyUI-J pack. ComfyUI Manager: search ComfyUI-J, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/Jannchie/ComfyUI-J
cd ComfyUI-J
pip install -r requirements.txt

No extra download step for this specific node - you'll need to have actually placed a textual inversion file somewhere ComfyUI can find it first, same as you would for any other embedding loader in the ecosystem.

Where people get burned

If the dropdown is empty, that almost always just means you don't have any textual inversion files installed yet, not that the node is broken - go get one (CivitAI still has a working, if much smaller than it used to be, supply of these for Illustrious and SDXL specifically) and it should populate.

The other mix-up worth flagging directly: textual inversion and LoRA are not the same format, and this pack only has a loader for the former. If the "character" or "style" you're trying to bring in is packaged as a LoRA rather than an embedding, this node can't help you - and since the rest of the pack has no LoRA support either, that particular gap doesn't have a workaround anywhere inside ComfyUI-J. And as with everything else feeding into a pipeline here, mismatching the embedding's trained architecture against the pipeline it's attached to won't throw an error - the trigger word will just do nothing meaningful in your prompt.

CategoryJannchie

Inputs (2)

NameTypeDefaultDescription
pipelineDIFFUSERS_PIPELINE—
texture_inversionCOMBO0 options:

Outputs (1)

NameTypeDescription
pipelineDIFFUSERS_PIPELINE—