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 Qwen VL encoder

What it means

Raised as a NotAMatchError by QwenVLEncoder_Diffusers_Config.from_model_on_disk when the candidate directory contains model_index.json or a transformer/ folder, marking it as a full diffusers pipeline. InvokeAI deliberately refuses to classify such directories as a standalone Qwen VL encoder because full pipelines (e.g. the ~40GB Qwen Image repo) must be registered as Main models, not just their text encoder.

Source

Thrown at invokeai/backend/model_manager/configs/qwen_vl_encoder.py:81

                preprocessor_config.json

    This lets users avoid downloading the full ~40 GB Qwen Image diffusers pipeline
    when they only need the Qwen2.5-VL encoder for use with a GGUF transformer.
    """

    base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)
    type: Literal[ModelType.QwenVLEncoder] = Field(default=ModelType.QwenVLEncoder)
    format: Literal[ModelFormat.QwenVLEncoder] = Field(default=ModelFormat.QwenVLEncoder)

    @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)

        # Reject anything that looks like a full pipeline (those are matched as Main models).
        if (mod.path / "model_index.json").exists() or (mod.path / "transformer").exists():
            raise NotAMatchError(
                "directory looks like a full diffusers pipeline (has model_index.json or transformer folder), "
                "not a standalone Qwen VL encoder"
            )

        text_encoder_dir = mod.path / "text_encoder"
        tokenizer_dir = mod.path / "tokenizer"

        if not text_encoder_dir.is_dir():
            raise NotAMatchError("missing text_encoder/ subfolder")
        if not tokenizer_dir.is_dir():
            raise NotAMatchError("missing tokenizer/ subfolder")

        config_path = text_encoder_dir / "config.json"
        if not config_path.is_file():
            raise NotAMatchError(f"missing {config_path}")

        try:
            with open(config_path, "r", encoding="utf-8") as f:

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Register the directory as a Main model instead — InvokeAI matches full pipelines through the main-model path.
  2. If you only want the encoder, extract/download a standalone layout with just text_encoder/ and tokenizer/ subfolders (no model_index.json, no transformer/).
  3. Copy text_encoder/ and tokenizer/ out into a new folder without model_index.json or transformer/, then import that.
  4. Use a HF repo that ships only the encoder components rather than the consolidated pipeline.

Example fix

// before (rejected: pipeline root)
qwen-image/
  model_index.json
  transformer/
  text_encoder/

// after (standalone encoder layout)
qwen-vl-encoder/
  text_encoder/
    config.json
    model.safetensors
  tokenizer/
    tokenizer_config.json
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

def is_full_pipeline_dir(root: Path) -> bool:
    return (root / "model_index.json").exists() or (root / "transformer").exists()

# before import:
root = Path("/path/to/model")
if is_full_pipeline_dir(root):
    print("Register as a Main model, not a standalone Qwen VL encoder")

Type guard

from pathlib import Path

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

Try / catch

try:
    invokeai_model_manager.probe(model_dir)
except NotAMatchError as e:
    if "full diffusers pipeline" in str(e):
        add_model_as_main(model_dir)  # register the pipeline via the main-model path instead
    else:
        raise

Prevention

When it happens

Trigger: Pointing the model import/probe at the root of a full diffusers pipeline directory (containing model_index.json, transformer/, text_encoder/, tokenizer/) so the QwenVLEncoder_Diffusers matcher runs first and rejects it.

Common situations: Downloading the whole Qwen Image or similar repo and adding its top-level folder; nesting an encoder inside a pipeline checkout; specifying the parent directory in InvokeAI's model-add UI instead of the text_encoder subtree.

Related errors


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