invoke-ai/InvokeAI · error · ValueError
There are no submodels in a TI model.
Error message
There are no submodels in a TI model.
What it means
A textual inversion (TI/embedding) model is a single artifact with no submodels, so the loader raises this ValueError whenever a submodel_type is provided. The message emphasizes that submodel requests are meaningless for TI embeddings.
Source
Thrown at invokeai/backend/model_manager/load/model_loaders/textual_inversion.py:33
SubModelType,
)
from invokeai.backend.textual_inversion import TextualInversionModelRaw
@ModelLoaderRegistry.register(base=BaseModelType.Any, type=ModelType.TextualInversion, format=ModelFormat.EmbeddingFile)
@ModelLoaderRegistry.register(
base=BaseModelType.Any, type=ModelType.TextualInversion, format=ModelFormat.EmbeddingFolder
)
class TextualInversionLoader(ModelLoader):
"""Class to load TI models."""
def _load_model(
self,
config: AnyModelConfig,
submodel_type: Optional[SubModelType] = None,
) -> AnyModel:
if submodel_type is not None:
raise ValueError("There are no submodels in a TI model.")
model = TextualInversionModelRaw.from_checkpoint(
file_path=config.path,
dtype=self._torch_dtype,
)
return model
# override
def _get_model_path(self, config: AnyModelConfig) -> Path:
model_path = self._app_config.models_path / config.path
if config.format == ModelFormat.EmbeddingFolder:
path = model_path / "learned_embeds.bin"
else:
path = model_path
if not path.exists():
raise OSError(f"The embedding file at {path} was not found")
View on GitHub (pinned to 0b6a024f2f)
Solutions
- Pass submodel_type=None when loading TI embeddings.
- Apply TI embeddings at pipeline level (prompt/concept loading), not via submodel requests.
- Filter TI models out of any submodel-loading loops in your code.
Example fix
// before model = loader.load_model(ti_config, submodel_type=SubModelType.TextEncoder) // after model = loader.load_model(ti_config, submodel_type=None)
Defensive patterns
Strategy: validation
Validate before calling
if model_type is ModelType.TextualInversion and submodel_type is not None:
submodel_type = None # TI embeddings have no submodels Type guard
def is_embedding(model_type: ModelType) -> bool:
return model_type is ModelType.TextualInversion Try / catch
try:
model = loader.load_model(ti_config, submodel_type=None)
except ValueError as e:
logger.error("TI load failed: %s", e)
raise Prevention
- Exclude TextualInversion models from submodel iteration loops.
- Pass submodel_type=None for all embedding loads.
- Separate embedding application logic from component-loading logic.
When it happens
Trigger: Calling load_model on a textual inversion config with submodel_type set (e.g. trying to fetch its 'text encoder' component) instead of None.
Common situations: Code iterating submodels of a main model that also touches TI embeddings; mistaking an embedding entry for a pipeline entry; automation that always requests a TextEncoder submodel.
Related errors
- There are no submodels in a LoRA model.
- Unexpected submodel requested for LLaVA OneVision model.
- Unexpected submodel requested for Spandrel model.
- Unexpected submodel requested for TextLLM model.
- Invalid or expired token
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/12812221abe7d8ae.
Report an issue: GitHub.