invoke-ai/InvokeAI · error · ValueError
{self.__class__} has the config param `addition_embed_type`
Error message
{self.__class__} has the config param `addition_embed_type` set to 'text_time' which requires the keyword argument `text_embeds` to be passed in `added_cond_kwargs` What it means
For models with addition_embed_type 'text_time' (SDXL-style UNets), forward() needs micro-conditioning text embeds supplied via added_cond_kwargs['text_embeds']. Missing it means the additive embedding branch cannot be computed, so this patched forward raises immediately.
Source
Thrown at invokeai/backend/util/hotfixes.py:687
aug_emb = None
if self.class_embedding is not None:
if class_labels is None:
raise ValueError("class_labels should be provided when num_class_embeds > 0")
if self.config.class_embed_type == "timestep":
class_labels = self.time_proj(class_labels)
class_emb = self.class_embedding(class_labels).to(dtype=self.dtype)
emb = emb + class_emb
if "addition_embed_type" in self.config:
if self.config.addition_embed_type == "text":
aug_emb = self.add_embedding(encoder_hidden_states)
elif self.config.addition_embed_type == "text_time":
if "text_embeds" not in added_cond_kwargs:
raise ValueError(
f"{self.__class__} has the config param `addition_embed_type` set to 'text_time' which \
requires the keyword argument `text_embeds` to be passed in `added_cond_kwargs`"
)
text_embeds = added_cond_kwargs.get("text_embeds")
if "time_ids" not in added_cond_kwargs:
raise ValueError(
f"{self.__class__} has the config param `addition_embed_type` set to 'text_time' which \
requires the keyword argument `time_ids` to be passed in `added_cond_kwargs`"
)
time_ids = added_cond_kwargs.get("time_ids")
time_embeds = self.add_time_proj(time_ids.flatten())
time_embeds = time_embeds.reshape((text_embeds.shape[0], -1))
add_embeds = torch.concat([text_embeds, time_embeds], dim=-1)
add_embeds = add_embeds.to(emb.dtype)
aug_emb = self.add_embedding(add_embeds)
emb = emb + aug_emb if aug_emb is not None else embView on GitHub (pinned to 0b6a024f2f)
Solutions
- Pass added_cond_kwargs={"text_embeds": pooled_prompt_embeds, "time_ids": ...} computed from the text encoder's pooled output
- Use the standard SDXL pipeline (StableDiffusionXLPipeline) which populates added_cond_kwargs for you
- Check that the checkpoint/config actually matches the call signature you are using
Example fix
// before
unet(latents, t, encoder_hidden_states)
// after
unet(latents, t, encoder_hidden_states, added_cond_kwargs={"text_embeds": pooled_embeds, "time_ids": time_ids}) Defensive patterns
Strategy: validation
Validate before calling
if getattr(unet.config, 'addition_embed_type', None) == 'text_time':
added_cond_kwargs = added_cond_kwargs or {}
assert 'text_embeds' in added_cond_kwargs, "SDXL UNet needs text_embeds" Type guard
def has_text_embeds(unet, added_cond_kwargs):
if getattr(unet.config, 'addition_embed_type', None) != 'text_time':
return True
return isinstance(added_cond_kwargs, dict) and 'text_embeds' in added_cond_kwargs Try / catch
try:
out = unet(x, t, emb, added_cond_kwargs=added_cond_kwargs)
except ValueError as e:
logger.error("missing added_cond_kwargs: %s", e)
raise Prevention
- Always build added_cond_kwargs from the pooled text encoder output for SDXL
- Keep text_embeds and time_ids constructed together
- Use StableDiffusionXLPipeline instead of manual forward where possible
When it happens
Trigger: Calling forward() on an SDXL UNet (addition_embed_type='text_time') without added_cond_kwargs, or with added_cond_kwargs lacking the 'text_embeds' key; running a base-UNet call path that only passes time_ids.
Common situations: Custom SDXL sampling/LoRA code that forgot text_embeds; reusing SD 1.5-style forward calls against an SDXL checkpoint; pipelines that strip added_cond_kwargs.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- {self.__class__} has the config param `addition_embed_type`
- {self.__class__} has the config param `addition_embed_type`
- {self.__class__} has the config param `addition_embed_type`
- Source image required for inpaint mask when inpaint model us
- Source image required for inpaint mask when inpaint model us
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/fba87c3eeb6ffcde.
Report an issue: GitHub.