invoke-ai/InvokeAI · error · MissingInputException

MissingInputException

Error message

MissingInputException

What it means

MissingInputException is raised in invoke_internal when a required field with no default is None at execution time and its declared input kind is Input.Any (not strictly Input.Connection). Unlike RequiredConnectionException, the value could have come from a direct assignment or a connection, but neither supplied one.

Source

Thrown at invokeai/app/invocations/baseinvocation.py:236

        """
        for field_name, field in type(self).model_fields.items():
            if not field.json_schema_extra or callable(field.json_schema_extra):
                # something has gone terribly awry, we should always have this and it should be a dict
                continue

            # Here we handle the case where the field is optional in the pydantic class, but required
            # in the `invoke()` method.

            orig_default = field.json_schema_extra.get("orig_default", PydanticUndefined)
            orig_required = field.json_schema_extra.get("orig_required", True)
            input_ = field.json_schema_extra.get("input", None)
            if orig_default is not PydanticUndefined and not hasattr(self, field_name):
                setattr(self, field_name, orig_default)
            if orig_required and orig_default is PydanticUndefined and getattr(self, field_name) is None:
                if input_ == Input.Connection:
                    raise RequiredConnectionException(type(self).model_fields["type"].default, field_name)
                elif input_ == Input.Any:
                    raise MissingInputException(type(self).model_fields["type"].default, field_name)

        # skip node cache codepath if it's disabled
        if services.configuration.node_cache_size == 0:
            return self.invoke(context)

        output: BaseInvocationOutput
        if self.use_cache:
            key = services.invocation_cache.create_key(self)
            cached_value = services.invocation_cache.get(key)
            if cached_value is None:
                services.logger.debug(f'Invocation cache miss for type "{self.get_type()}": {self.id}')
                output = self.invoke(context)
                services.invocation_cache.save(key, output)
                return output
            else:
                services.logger.debug(f'Invocation cache hit for type "{self.get_type()}": {self.id}')
                return cached_value
        else:

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Provide a value for the missing field, either via an edge or a direct input on the node.
  2. Check for schema/version drift: re-open and re-save the workflow in the current InvokeAI version so defaults are applied.
  3. Give the field a default in its InputField declaration if a sensible default exists.
  4. When testing with run_node, set every required field on the invocation instance.

Example fix

// before
node = DenoiseLatents(id="dn")  # positive_conditioning never set

// after
node = DenoiseLatents(
  id="dn",
  positive_conditioning=prompt_field,
  negative_conditioning=neg_prompt_field,
  latents=latents_field,
)
Defensive patterns

Strategy: validation

Validate before calling

# check all required no-default fields are set before running
for node in graph.nodes.values():
    for name, field in type(node).model_fields.items():
        extra = field.json_schema_extra or {}
        if extra.get("orig_required", True) and field.is_required() and getattr(node, name, None) is None:
            raise ValueError(f"node {node.id}: required input '{name}' is missing")

Try / catch

try:
    result = run_node(node, context)
except MissingInputException as e:
    logger.error("node %s missing input %s", e.node_id, e.field_name)

Prevention

When it happens

Trigger: A node whose required Input.Any field has neither an incoming edge nor an explicit direct value; calling run_node directly on a partially constructed invocation; graph deserialization dropping a field value.

Common situations: Programmatic graph building where a required prompt/string input was omitted; older saved workflows whose schema changed so the field no longer deserializes; testing harnesses instantiating invocations without setting required fields.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/df3353076f263dca. Report an issue: GitHub.