invoke-ai/InvokeAI · error · ValueError

VAE '{vae_config.name}' is not compatible with Krea-2. Selec

Error message

VAE '{vae_config.name}' is not compatible with Krea-2. Select a Qwen Image or Anima VAE.

What it means

When a standalone VAE is supplied to Krea2ModelLoader, it must be a VAE-type model based on QwenImage or Anima; Krea-2 reuses those VAE architectures. Supplying any other VAE (wrong type or base) raises this ValueError during invoke().

Source

Thrown at invokeai/app/invocations/krea2_model_loader.py:92

    def invoke(self, context: InvocationContext) -> Krea2ModelLoaderOutput:
        main_config = context.models.get_config(self.model)
        if main_config.base is not BaseModelType.Krea2 or main_config.type is not ModelType.Main:
            raise ValueError(
                f"Model '{main_config.name}' is not a Krea-2 main model. Select a Krea-2 transformer model."
            )

        # Transformer always comes from the main model.
        transformer = self.model.model_copy(update={"submodel_type": SubModelType.Transformer})

        # Determine VAE source.
        if self.vae_model is not None:
            vae_config = context.models.get_config(self.vae_model)
            if vae_config.type is not ModelType.VAE or vae_config.base not in (
                BaseModelType.QwenImage,
                BaseModelType.Anima,
            ):
                raise ValueError(
                    f"VAE '{vae_config.name}' is not compatible with Krea-2. Select a Qwen Image or Anima VAE."
                )
            vae = self.vae_model.model_copy(update={"submodel_type": SubModelType.VAE})
        else:
            self._validate_diffusers_format(context, self.model, "Krea-2")
            vae = self.model.model_copy(update={"submodel_type": SubModelType.VAE})

        # Determine Qwen3-VL Encoder source.
        if self.qwen3_vl_encoder_model is not None:
            encoder_config = context.models.get_config(self.qwen3_vl_encoder_model)
            if encoder_config.type is not ModelType.Qwen3VLEncoder:
                raise ValueError(f"Encoder '{encoder_config.name}' is not a Qwen3-VL encoder compatible with Krea-2.")
            tokenizer = self.qwen3_vl_encoder_model.model_copy(update={"submodel_type": SubModelType.Tokenizer})
            text_encoder = self.qwen3_vl_encoder_model.model_copy(update={"submodel_type": SubModelType.TextEncoder})
        else:
            self._validate_diffusers_format(context, self.model, "Krea-2")
            tokenizer = self.model.model_copy(update={"submodel_type": SubModelType.Tokenizer})
            text_encoder = self.model.model_copy(update={"submodel_type": SubModelType.TextEncoder})

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Select a VAE whose base is QwenImage or Anima in the vae_model field.
  2. Leave vae_model unset so the loader extracts the VAE from the Diffusers-format Krea-2 main model.
  3. Re-import the intended VAE with the correct base type (QwenImage or Anima) in the model manager.

Example fix

// before
Krea2ModelLoader(model=krea2_main, vae_model=sdxl_vae)
// after
Krea2ModelLoader(model=krea2_main, vae_model=qwen_image_vae)  # or omit vae_model
Defensive patterns

Strategy: validation

Validate before calling

if vae_field is not None:
    cfg = context.models.get_config(vae_field)
    if cfg.type is not ModelType.VAE or cfg.base not in (BaseModelType.QwenImage, BaseModelType.Anima):
        raise ValueError(f"VAE {cfg.name} incompatible with Krea-2")

Type guard

from invokeai.backend.model_manager.config import BaseModelType, ModelType

def is_krea2_compatible_vae(cfg) -> bool:
    return cfg.type is ModelType.VAE and cfg.base in (BaseModelType.QwenImage, BaseModelType.Anima)

Try / catch

try:
    output = loader.invoke(context)
except ValueError as e:
    if "not compatible with Krea-2" in str(e) and "VAE" in str(e):
        output = loader.model_copy(update={"vae_model": None}).invoke(context)
    else:
        raise

Prevention

When it happens

Trigger: Setting Krea2ModelLoader.vae_model to a config whose type is not ModelType.VAE, or whose base is not QwenImage or Anima (e.g. an SDXL VAE or a non-VAE model record).

Common situations: Picking a VAE from an incompatible model family in the node selector; reusing a VAE from older InvokeAI workflows (SD1.5/SDXL); a VAE imported with the wrong base classification.

Related errors


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