invoke-ai/InvokeAI · error · NotAMatchError

directory looks like a full diffusers pipeline (has model_in

Error message

directory looks like a full diffusers pipeline (has model_index.json or transformer folder), not a standalone Qwen3-VL encoder

What it means

Qwen3VLEncoder_Qwen3VLEncoder_Config.from_model_on_disk scans a model directory and rejects it when it looks like a full diffusers pipeline (contains model_index.json or a transformer/ subfolder). Full pipelines must be registered as main models, not as a standalone text encoder, so InvokeAI throws this NotAMatchError to steer the import to the right model type.

Source

Thrown at invokeai/backend/model_manager/configs/qwen3_vl_encoder.py:111

    Klein) and the Qwen2.5-VL ``QwenVLEncoder`` (Qwen Image).
    """

    base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
    type: Literal[ModelType.Qwen3VLEncoder] = Field(default=ModelType.Qwen3VLEncoder)
    format: Literal[ModelFormat.Qwen3VLEncoder] = Field(default=ModelFormat.Qwen3VLEncoder)
    cpu_only: bool | None = Field(default=None, description="Whether this model should run on CPU only")

    @classmethod
    def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:
        raise_if_not_dir(mod)

        raise_for_override_fields(cls, override_fields)

        # Exclude full pipeline models - these should be matched as main models, not just encoders.
        model_index_path = mod.path / "model_index.json"
        transformer_path = mod.path / "transformer"
        if model_index_path.exists() or transformer_path.exists():
            raise NotAMatchError(
                "directory looks like a full diffusers pipeline (has model_index.json or transformer folder), "
                "not a standalone Qwen3-VL encoder"
            )

        # Support both a nested text_encoder/config.json and a standalone config.json at the root.
        config_path_nested = mod.path / "text_encoder" / "config.json"
        config_path_direct = mod.path / "config.json"

        if config_path_nested.exists():
            expected_config_path = config_path_nested
        elif config_path_direct.exists():
            expected_config_path = config_path_direct
        else:
            raise NotAMatchError(f"unable to load config file: {config_path_nested} does not exist")

        # Qwen3-VL uses the Qwen3VLModel / Qwen3VLForConditionalGeneration architecture.
        raise_for_class_name(
            expected_config_path,

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Import the full pipeline directory as a main model instead of a text encoder, so InvokeAI splits it into components automatically.
  2. Alternatively, add only the text_encoder subfolder (or a standalone directory containing config.json plus weights) as the Qwen3-VL encoder.
  3. Remove or rename model_index.json / move the transformer/ folder out if you are assembling a custom standalone encoder directory.

Example fix

// before: whole pipeline folder added as encoder
models/krea2/           # contains model_index.json, transformer/, text_encoder/ -> NotAMatchError
// after: add the encoder component only
models/krea2-text-encoder/  # config.json + model.safetensors + tokenizer files
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

def looks_like_full_pipeline(model_dir: str) -> bool:
    p = Path(model_dir)
    return (p / "model_index.json").exists() or (p / "transformer").is_dir()

# Add models/encoder only if not looks_like_full_pipeline(...); otherwise import as a main model.

Type guard

def is_standalone_encoder_dir(p) -> bool:
    from pathlib import Path
    p = Path(p)
    return p.is_dir() and not (p / "model_index.json").exists() and not (p / "transformer").is_dir()

Try / catch

try:
    cfg = Qwen3VLEncoder_Qwen3VLEncoder_Config.from_model_on_disk(mod, {})
except NotAMatchError as e:
    if "full diffusers pipeline" in str(e):
        logger.info("%s is a full pipeline; register it as a main model instead", mod.path)

Prevention

When it happens

Trigger: Calling from_model_on_disk (during model scan/import) on a directory that contains invokeai/backend/model_manager/configs/qwen3_vl_encoder.py-recognized layout markers model_index.json or transformer/ at its root, e.g. the full Krea-2 or Qwen3-VL diffusers repo checked out as one folder.

Common situations: Downloading an entire HuggingFace diffusers pipeline repo (with model_index.json, transformer/, text_encoder/, vae/, tokenizer/) and adding the whole folder as a text encoder; pointing the scan folder at a pipeline root instead of the text_encoder subfolder.

Related errors


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