invoke-ai/InvokeAI · error · NotAMatchError
unable to load config file: {config_path_nested} does not ex
Error message
unable to load config file: {config_path_nested} does not exist What it means
The standalone Qwen3-VL encoder config expects a config.json either in a text_encoder/ subfolder or at the directory root. When neither exists it cannot identify the architecture and throws this NotAMatchError (the message names the nested path it probed first). Without config.json InvokeAI cannot confirm the directory is a Qwen3VLModel.
Source
Thrown at invokeai/backend/model_manager/configs/qwen3_vl_encoder.py:125
# 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,
{
"Qwen3VLModel",
"Qwen3VLForConditionalGeneration",
},
)
_validate_krea2_qwen3_vl_config(expected_config_path)
if config_path_nested.exists():
weights_path = mod.path / "text_encoder"
tokenizer_path = mod.path / "tokenizer"
else:
weights_path = mod.path
tokenizer_path = mod.path
View on GitHub (pinned to 0b6a024f2f)
Solutions
- Add the missing config.json: place it at the folder root, or inside a text_encoder/ subfolder alongside the weights.
- Re-download the model directory from HuggingFace completely, ensuring config.json is included (check ignore patterns like *.json filters).
- If the config lives in another subfolder, restructure so it is at mod.path/config.json or mod.path/text_encoder/config.json.
- Verify the config's architectures field lists Qwen3VLModel or Qwen3VLForConditionalGeneration once the file is present.
Example fix
// before models/qwen3vl-encoder/ model-00001-of-00002.safetensors (no config.json) -> NotAMatchError // after models/qwen3vl-encoder/ config.json model-00001-of-00002.safetensors model-00002-of-00002.safetensors
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
def has_qwen3vl_config(model_dir: str) -> bool:
p = Path(model_dir)
return (p / "text_encoder" / "config.json").exists() or (p / "config.json").exists() Type guard
def config_json_present(p) -> bool:
from pathlib import Path
p = Path(p)
return (p / "config.json").is_file() or (p / "text_encoder" / "config.json").is_file() Try / catch
try:
cfg = Qwen3VLEncoder_Qwen3VLEncoder_Config.from_model_on_disk(mod, {})
except NotAMatchError as e:
if "does not exist" in str(e) and "config.json" in str(e):
logger.warning("Missing config.json in %s; re-download the model directory", mod.path) Prevention
- Download models with huggingface-cli download or snapshot_download so all repo files (including config.json) are fetched.
- Check .gitignore/ignore filters - exclude patterns like *.json silently skip config files.
- Keep the canonical layout: config.json at root or under text_encoder/.
- After unzipping/moving a model, verify config.json is present before rescanning.
When it happens
Trigger: from_model_on_disk is invoked on a directory where both mod.path/text_encoder/config.json and mod.path/config.json are missing - e.g. a folder with only weight shards, or a ComfyUI-style folder where config lives under a differently named subfolder.
Common situations: Downloading only the weights from HuggingFace (config.json skipped by .gitignore or partial download), copying weights without their config, renaming text_encoder to another name, or pointing the import at a nested folder one level too deep/shallow.
Related errors
- standalone Qwen3-VL encoder directory does not contain model
- directory does not contain Gemma2 tokenizer files (tokenizer
- missing ip_adapter.bin weights file
- missing image_encoder.txt metadata file
- unrecognized token vector length {token_vector_length}
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/30677ff3da7bc639.
Report an issue: GitHub.