{"record":{"id":"30677ff3da7bc639","repo":"invoke-ai/InvokeAI","slug":"unable-to-load-config-file-config-path-nested-d","errorCode":null,"errorMessage":"unable to load config file: {config_path_nested} does not exist","messagePattern":"unable to load config file: (.+?) does not exist","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/qwen3_vl_encoder.py","lineNumber":125,"sourceCode":"        # Exclude full pipeline models - these should be matched as main models, not just encoders.\n        model_index_path = mod.path / \"model_index.json\"\n        transformer_path = mod.path / \"transformer\"\n        if model_index_path.exists() or transformer_path.exists():\n            raise NotAMatchError(\n                \"directory looks like a full diffusers pipeline (has model_index.json or transformer folder), \"\n                \"not a standalone Qwen3-VL encoder\"\n            )\n\n        # Support both a nested text_encoder/config.json and a standalone config.json at the root.\n        config_path_nested = mod.path / \"text_encoder\" / \"config.json\"\n        config_path_direct = mod.path / \"config.json\"\n\n        if config_path_nested.exists():\n            expected_config_path = config_path_nested\n        elif config_path_direct.exists():\n            expected_config_path = config_path_direct\n        else:\n            raise NotAMatchError(f\"unable to load config file: {config_path_nested} does not exist\")\n\n        # Qwen3-VL uses the Qwen3VLModel / Qwen3VLForConditionalGeneration architecture.\n        raise_for_class_name(\n            expected_config_path,\n            {\n                \"Qwen3VLModel\",\n                \"Qwen3VLForConditionalGeneration\",\n            },\n        )\n        _validate_krea2_qwen3_vl_config(expected_config_path)\n\n        if config_path_nested.exists():\n            weights_path = mod.path / \"text_encoder\"\n            tokenizer_path = mod.path / \"tokenizer\"\n        else:\n            weights_path = mod.path\n            tokenizer_path = mod.path\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/qwen3_vl_encoder.py#L107-L143","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nmodels/qwen3vl-encoder/\n  model-00001-of-00002.safetensors\n  (no config.json) -> NotAMatchError\n// after\nmodels/qwen3vl-encoder/\n  config.json\n  model-00001-of-00002.safetensors\n  model-00002-of-00002.safetensors","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef has_qwen3vl_config(model_dir: str) -> bool:\n    p = Path(model_dir)\n    return (p / \"text_encoder\" / \"config.json\").exists() or (p / \"config.json\").exists()","typeGuard":"def config_json_present(p) -> bool:\n    from pathlib import Path\n    p = Path(p)\n    return (p / \"config.json\").is_file() or (p / \"text_encoder\" / \"config.json\").is_file()","tryCatchPattern":"try:\n    cfg = Qwen3VLEncoder_Qwen3VLEncoder_Config.from_model_on_disk(mod, {})\nexcept NotAMatchError as e:\n    if \"does not exist\" in str(e) and \"config.json\" in str(e):\n        logger.warning(\"Missing config.json in %s; re-download the model directory\", mod.path)","preventionTips":["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."],"tags":["model-import","missing-file","invokeai","huggingface"],"backgroundTag":"missing-config-file","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}