{"record":{"id":"3507e83260b7fc26","repo":"invoke-ai/InvokeAI","slug":"the-model-name-model-must-be-a-diffusers-format","errorCode":null,"errorMessage":"The {model_name} model must be a Diffusers format model. The selected model '{config.name}' is in {config.format.value} format.","messagePattern":"The (.+?) model must be a Diffusers format model\\. The selected model '(.+?)' is in (.+?) format\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux2_dev_model_loader.py","lineNumber":191,"sourceCode":"        self, context: InvocationContext, model: ModelIdentifierField, model_name: str\n    ) -> AnyModelConfig:\n        \"\"\"Validate that a model is a Diffusers-format pipeline and return its config.\n\n        Deliberately format-only, because this also gates the VAE-extraction path: the 32-channel\n        ``AutoencoderKLFlux2`` is shared between Klein and [dev] — the repo ships the Klein-sourced\n        ``flux2_vae`` as a dependency of every [dev] GGUF starter model — so a Klein pipeline is a\n        legitimate VAE source for a [dev] transformer. ``mistral_source_model`` is not\n        variant-filtered in the workflow editor, so the *encoder* path is where variant gating\n        belongs — see ``_validate_encoder_source``.\n\n        Note the [dev] linear UI is stricter than this: ``buildFLUXGraph`` sources from dev-only\n        pipelines and readiness gates on one, so the Klein-pipeline-as-VAE-source case is reachable\n        through the workflow editor only. (The Klein loader's linear UI *does* fall back to any\n        FLUX.2 diffusers pipeline for the VAE.)\n        \"\"\"\n        config = context.models.get_config(model)\n        if config.format != ModelFormat.Diffusers:\n            raise ValueError(\n                f\"The {model_name} model must be a Diffusers format model. \"\n                f\"The selected model '{config.name}' is in {config.format.value} format.\"\n            )\n        return config\n\n    def _validate_encoder_source(\n        self, context: InvocationContext, model: ModelIdentifierField, model_name: str\n    ) -> None:\n        \"\"\"Validate a Diffusers pipeline used as the *text encoder* source.\"\"\"\n        config = self._validate_diffusers_format(context, model, model_name)\n        # The source's tokenizer/encoder are extracted and paired with the [dev] transformer.\n        # A Klein pipeline's Qwen3 tokenizer + encoder silently pass the layer-count guard and\n        # produce a wrong-width conditioning that only surfaces as an opaque matmul error deep in\n        # denoise, so reject non-[dev] sources here where the user still gets a clear message.\n        variant = getattr(config, \"variant\", None)\n        if variant is not None and variant != Flux2VariantType.Dev:\n            raise ValueError(\n                f\"The {model_name} model must be a FLUX.2 [dev] pipeline, \"","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux2_dev_model_loader.py#L173-L209","documentation":"_validate_diffusers_format throws this when a model supplied as a VAE or encoder source is not in Diffusers format. Only Diffusers-format pipelines can have submodels (VAE, tokenizer, text encoder) extracted via model_copy; single-file or GGUF checkpoints cannot. The f-string interpolates the expected role, the actual model name, and its actual format.","triggerScenarios":"_validate_diffusers_format(context, model, model_name) is called from invoke() (for 'Mistral Source') or _validate_encoder_source(), and context.models.get_config(model).format is not ModelFormat.Diffusers.","commonSituations":"A user points the 'Mistral Source' or 'VAE' input at a single-file checkpoint or GGUF model instead of a Diffusers FLUX.2 [dev] pipeline, often after downloading a ComfyUI-style single-file model.","solutions":["Select a Diffusers-format FLUX.2 [dev] model (the message names the format of the wrongly selected model) as the source.","Download the Diffusers version of the FLUX.2 [dev] pipeline and register it in InvokeAI's model manager, then use that as the source."],"exampleFix":"// before\nmistral_source = single_file_flux2_checkpoint  // format: checkpoint\n// after\nmistral_source = diffusers_flux2_dev_pipeline  // format: diffusers","handlingStrategy":"validation","validationCode":"config = context.models.get_config(model)\nif config.format != ModelFormat.Diffusers:\n    raise ValueError(f\"{model_name} must be Diffusers format; '{config.name}' is {config.format.value}\")","typeGuard":"def is_diffusers(config) -> bool:\n    return getattr(config, \"format\", None) == ModelFormat.Diffusers","tryCatchPattern":"try:\n    output = loader.invoke(context)\nexcept ValueError as e:\n    if \"must be a Diffusers format model\" in str(e):\n        loader.mistral_source_model = select_diffusers_flux2_model(context)\n        output = loader.invoke(context)\n    else:\n        raise","preventionTips":["Only point VAE/Mistral Source inputs at models imported as Diffusers format.","Check the model's format field in the Model Manager UI before wiring it.","Download Diffusers-format pipelines rather than ComfyUI single-file checkpoints."],"tags":["invokeai","model-format","diffusers","validation","flux2"],"backgroundTag":"wrong-model-format","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}