{"record":{"id":"cc364ddc6089f2be","repo":"invoke-ai/InvokeAI","slug":"unsupported-ip-adapter-type-type-self-ip-adapter","errorCode":null,"errorMessage":"Unsupported IP-Adapter type: {type(self.ip_adapter)}","messagePattern":"Unsupported IP-Adapter type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux_denoise.py","lineNumber":903,"sourceCode":"        # Prepare mask conditioning.\n        mask = mask[:, 0, :, :]\n        # Rearrange mask to a 16-channel representation that matches the shape of the VAE-encoded latent space.\n        mask = einops.rearrange(mask, \"b (h ph) (w pw) -> b (ph pw) h w\", ph=8, pw=8)\n        mask = pack(mask)\n\n        # Merge image and mask conditioning.\n        img_cond = torch.cat((cond_img, mask), dim=-1)\n        return img_cond\n\n    def _normalize_ip_adapter_fields(self) -> list[IPAdapterField]:\n        if self.ip_adapter is None:\n            return []\n        elif isinstance(self.ip_adapter, IPAdapterField):\n            return [self.ip_adapter]\n        elif isinstance(self.ip_adapter, list):\n            return self.ip_adapter\n        else:\n            raise ValueError(f\"Unsupported IP-Adapter type: {type(self.ip_adapter)}\")\n\n    def _prep_ip_adapter_image_prompt_clip_embeds(\n        self,\n        ip_adapter_fields: list[IPAdapterField],\n        context: InvocationContext,\n        device: torch.device,\n    ) -> tuple[list[torch.Tensor], list[torch.Tensor]]:\n        \"\"\"Run the IPAdapter CLIPVisionModel, returning image prompt embeddings.\"\"\"\n        clip_image_processor = CLIPImageProcessor()\n\n        pos_image_prompt_clip_embeds: list[torch.Tensor] = []\n        neg_image_prompt_clip_embeds: list[torch.Tensor] = []\n        for ip_adapter_field in ip_adapter_fields:\n            # `ip_adapter_field.image` could be a list or a single ImageField. Normalize to a list here.\n            ipa_image_fields: list[ImageField]\n            if isinstance(ip_adapter_field.image, ImageField):\n                ipa_image_fields = [ip_adapter_field.image]\n            elif isinstance(ip_adapter_field.image, list):","sourceCodeStart":885,"sourceCodeEnd":921,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux_denoise.py#L885-L921","documentation":"FluxDenoise._normalize_ip_adapter_fields expects the ip_adapter input to be either a single IPAdapterField, a list of them, or None. Any other Python type (str, dict, wrong field class) reaching _run_diffusion raises this ValueError because FLUX cannot interpret the IP-Adapter input shape.","triggerScenarios":"Graph wiring passes a non-IPAdapterField value (e.g. a raw model field, image field, or deprecated IP-Adapter invocation output) into the ip_adapter input of the FLUX Denoise invocation.","commonSituations":"Loading an old workflow JSON created before the ip_adapter field was typed as IPAdapterField; custom nodes emitting the wrong output type; manual graph edits connecting an incompatible output to ip_adapter.","solutions":["Connect an IP-Adapter invocation (which outputs IPAdapterField) or a list of them to the flux_denoise ip_adapter input.","Re-create the workflow in the current InvokeAI version instead of editing an old exported graph JSON.","If writing a custom node, declare the output type as IPAdapterField and return IPAdapterField or list[IPAdapterField]."],"exampleFix":"// before: ip_adapter input wired from a generic model loader output\n// after\nfrom invokeai.app.invocations.ip_adapter import IPAdapterInvocation\n# wire IPAdapterInvocation.ip_adapter -> FluxDenoiseInvocation.ip_adapter","handlingStrategy":"type-guard","validationCode":"from invokeai.app.invocations.ip_adapter import IPAdapterField\nassert ip_adapter_input is None or isinstance(ip_adapter_input, (IPAdapterField, list)) and all(isinstance(f, IPAdapterField) for f in (ip_adapter_input if isinstance(ip_adapter_input, list) else [ip_adapter_input]))","typeGuard":"def is_valid_ip_adapter_input(v) -> bool:\n    if v is None or isinstance(v, IPAdapterField):\n        return True\n    return isinstance(v, list) and all(isinstance(f, IPAdapterField) for f in v)","tryCatchPattern":"try:\n    result = flux_denoise.invoke(context)\nexcept ValueError as e:\n    if str(e).startswith(\"Unsupported IP-Adapter type\"):\n        log.error(\"ip_adapter input must be IPAdapterField or list[IPAdapterField]\")\n    else:\n        raise","preventionTips":["Only wire IP-Adapter invocation outputs into flux_denoise.ip_adapter.","Validate graph connections after importing shared workflow JSONs.","Keep custom node output types annotated as IPAdapterField."],"tags":["python","valueerror","flux","ip-adapter","type-mismatch"],"backgroundTag":"unsupported-argument-type","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}