{"record":{"id":"b68797367a717436","repo":"invoke-ai/InvokeAI","slug":"the-component-source-model-must-be-in-diffusers-fo","errorCode":null,"errorMessage":"The Component Source model must be in Diffusers format. The selected model '{source_config.name}' is in {source_config.format.value} format.","messagePattern":"The Component Source model must be in Diffusers format\\. The selected model '(.+?)' is in (.+?) format\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/wan_model_loader.py","lineNumber":320,"sourceCode":"                transformer_low_noise=transformer_low_noise,\n                boundary_ratio=boundary_ratio,\n            ),\n            wan_t5_encoder=WanT5EncoderField(tokenizer=tokenizer, text_encoder=text_encoder),\n            vae=VAEField(vae=vae),\n        )\n\n    @staticmethod\n    def _validate_main_config(config: object, label: str) -> None:\n        if getattr(config, \"base\", None) != BaseModelType.Wan or getattr(config, \"type\", None) != ModelType.Main:\n            raise ValueError(f\"The {label} model must resolve to a Wan main model.\")\n\n    @staticmethod\n    def _validate_component_source_format(context: InvocationContext, model: ModelIdentifierField) -> None:\n        source_config = context.models.get_config(model)\n        if source_config.base != BaseModelType.Wan or source_config.type != ModelType.Main:\n            raise ValueError(\"The Component Source model must resolve to a Wan main model.\")\n        if source_config.format != ModelFormat.Diffusers:\n            raise ValueError(\n                f\"The Component Source model must be in Diffusers format. \"\n                f\"The selected model '{source_config.name}' is in {source_config.format.value} format.\"\n            )\n\n    @staticmethod\n    def _validate_component_source_vae(\n        context: InvocationContext, model: ModelIdentifierField, main_variant: WanVariantType\n    ) -> None:\n        WanModelLoaderInvocation._validate_component_source_format(context, model)\n        source_config = context.models.get_config(model)\n        source_variant = getattr(source_config, \"variant\", None)\n        main_is_ti2v = main_variant == WanVariantType.TI2V_5B\n        source_is_ti2v = source_variant == WanVariantType.TI2V_5B\n        if main_is_ti2v != source_is_ti2v:\n            raise ValueError(\n                \"The Component Source VAE is incompatible with the selected transformer. \"\n                \"TI2V-5B requires the 48-channel Wan 2.2 VAE; A14B models require the 16-channel Wan 2.1 VAE.\"\n            )","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/wan_model_loader.py#L302-L338","documentation":"Even when the Component Source is a Wan Main model, submodel extraction (VAE/tokenizer/text-encoder via model_copy) only works for Diffusers folder layouts. _validate_component_source_format raises this ValueError if source_config.format != ModelFormat.Diffusers, reporting the actual format found.","triggerScenarios":"invoke() with component_source set to a Wan Main model registered as GGUF or checkpoint (single-file safetensors) rather than a Diffusers folder.","commonSituations":"Pointing Component Source at a single-file Wan checkpoint or GGUF main model, which has no subfolders to extract VAE/tokenizer from; importing a main model from a single archive file.","solutions":["Select a Diffusers-format Wan Main model as Component Source","Download/import the model as a Diffusers folder and re-register it","If only a single-file main model exists, provide standalone VAE and T5 encoder overrides instead of Component Source"],"exampleFix":"// before\ncomponent_source=ModelIdentifierField(key='wan-main-gguf', submodel_type=SubModelType.Transformer)\n// after\ncomponent_source=ModelIdentifierField(key='wan-main-diffusers', submodel_type=SubModelType.Transformer)","handlingStrategy":"validation","validationCode":"cfg = context.models.get_config(invocation.component_source)\nif cfg.format != ModelFormat.Diffusers:\n    raise ValueError(f\"component_source must be Diffusers format, got {cfg.format.value}\")","typeGuard":"def is_diffusers_wan_main(field, ctx) -> bool:\n    cfg = ctx.models.get_config(field)\n    return cfg.base == BaseModelType.Wan and cfg.type == ModelType.Main and cfg.format == ModelFormat.Diffusers","tryCatchPattern":"try:\n    output = invocation.invoke(context)\nexcept ValueError as e:\n    if 'Component Source model must be in Diffusers format' in str(e):\n        invocation.component_source = select_diffusers_wan_main()","preventionTips":["Keep a Diffusers-format Wan main model installed specifically for use as Component Source","Don't wire GGUF/checkpoint main models into Component Source","Filter by format Diffusers in the Model Manager before selecting"],"tags":["model-loader","unsupported-format","wan","diffusers"],"backgroundTag":"unsupported-model-format","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}