invoke-ai/InvokeAI · error · ValueError

Unexpected IP-Adapter method: '{self.method}'.

Error message

Unexpected IP-Adapter method: '{self.method}'.

What it means

Final fallback in invoke(): after checking method against 'style', 'composition', 'style_precise', 'style_strong', and 'full', any other value raises 'Unexpected IP-Adapter method'. The input field is typed Literal["full", "style", "composition", "style_strong", "style_precise"], so this normally only fires when a stale/invalid workflow graph bypasses pydantic validation (e.g. an old serialized workflow or hand-edited graph with an obsolete method string).

Source

Thrown at invokeai/app/invocations/ip_adapter.py:187

                    "up_blocks.2.attentions.2",
                    "up_blocks.0.attentions.0",
                    "up_blocks.1.attentions.0",
                    "up_blocks.2.attentions.0",
                    "down_blocks.0.attentions.0",
                    "down_blocks.0.attentions.1",
                    "down_blocks.0.attentions.2",
                    "down_blocks.1.attentions.0",
                    "down_blocks.1.attentions.1",
                    "down_blocks.1.attentions.2",
                    "down_blocks.2.attentions.0",
                    "down_blocks.2.attentions.2",
                ]
            else:
                raise ValueError(f"Unsupported IP-Adapter base type: '{ip_adapter_info.base}'.")
        elif self.method == "full":
            target_blocks = ["block"]
        else:
            raise ValueError(f"Unexpected IP-Adapter method: '{self.method}'.")

        return IPAdapterOutput(
            ip_adapter=IPAdapterField(
                image=self.image,
                ip_adapter_model=self.ip_adapter_model,
                image_encoder_model=ModelIdentifierField.from_config(image_encoder_model),
                weight=self.weight,
                target_blocks=target_blocks,
                begin_step_percent=self.begin_step_percent,
                end_step_percent=self.end_step_percent,
                mask=self.mask,
                method=self.method,
            ),
        )

    @classmethod
    def get_clip_image_encoder(
        cls, context: InvocationContext, image_encoder_model_id: str, image_encoder_model_name: str

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Open the workflow in the editor and set the IP-Adapter node's method to one of: full, style, composition, style_strong, style_precise.
  2. Fix the method string in the workflow JSON (grep for the ip_adapter node's 'method' key).
  3. Upgrade/re-save the workflow with the current InvokeAI version so serialized fields are migrated and re-validated.

Example fix

// before (workflow JSON)
"method": "precise"
// after
"method": "style_precise"
Defensive patterns

Strategy: validation

Validate before calling

ALLOWED = {"full", "style", "composition", "style_strong", "style_precise"}
if node.get("method") not in ALLOWED:
    raise ValueError(f"Invalid IP-Adapter method {node.get('method')!r}; expected one of {sorted(ALLOWED)}")

Type guard

from typing import Literal, get_args
Method = Literal["full", "style", "composition", "style_strong", "style_precise"]
def is_valid_method(v: object) -> bool:
    return v in get_args(Method)

Try / catch

try:
    out = invoke(node)
except ValueError as e:
    if "Unexpected IP-Adapter method" in str(e):
        node.method = "full"
        out = invoke(node)

Prevention

When it happens

Trigger: Submitting a workflow graph whose ip_adapter node has method set to a value outside the five allowed literals — typically a graph saved by an older InvokeAI version before a rename/removal, or a hand-edited/programmatically-built graph that skips validation.

Common situations: Loading an old workflow file after an InvokeAI upgrade changed the method enum; scripting graph JSON by hand with a typo like 'styles' or 'precise'; third-party tooling generating graphs with invalid method values.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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