{"record":{"id":"abd70e657fb195b8","repo":"invoke-ai/InvokeAI","slug":"unsupported-model-source-url","errorCode":null,"errorMessage":"Unsupported model source: '{url}'","messagePattern":"Unsupported model source: '(.+?)'","errorType":"exception","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"invokeai/app/services/model_install/model_install_default.py","lineNumber":1609,"sourceCode":"\n    def _signal_job_cancelled(self, job: ModelInstallJob) -> None:\n        self._logger.info(f\"Model install canceled: {job.source}\")\n        if job._install_tmpdir is not None:\n            self._delete_install_marker(job._install_tmpdir)\n        if self._event_bus:\n            self._event_bus.emit_model_install_cancelled(job)\n\n    @staticmethod\n    def get_fetcher_from_url(url: str) -> Type[ModelMetadataFetchBase]:\n        \"\"\"\n        Return a metadata fetcher appropriate for provided url.\n\n        This used to be more useful, but the number of supported model\n        sources has been reduced to HuggingFace alone.\n        \"\"\"\n        if re.match(r\"^https?://huggingface.co/[^/]+/[^/]+$\", url.lower()):\n            return HuggingFaceMetadataFetch\n        raise ValueError(f\"Unsupported model source: '{url}'\")\n\n    @staticmethod\n    def _normalize_huggingface_blob_url(url: AnyHttpUrl) -> Url:\n        \"\"\"Convert Hugging Face file page URLs to direct download URLs.\"\"\"\n        return Url(\n            re.sub(\n                r\"^(https?://huggingface\\.co/[^/]+/[^/]+)/blob/([^?#]+)([?#].*)?$\",\n                r\"\\1/resolve/\\2\\3\",\n                str(url),\n                flags=re.IGNORECASE,\n            )\n        )\n","sourceCodeStart":1591,"sourceCodeEnd":1622,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/model_install/model_install_default.py#L1591-L1622","documentation":"get_fetcher_from_url selects the metadata fetcher class for a model source URL. InvokeAI has reduced supported sources to HuggingFace only, so any URL that does not match the https(s)://huggingface.co/<org>/<repo> pattern raises this ValueError. It is thrown during model install when resolving remote files from a source string.","triggerScenarios":"Calling install/download APIs with a source URL that is not a HuggingFace repo page: a direct Civitai link, a raw file URL (e.g. huggingface.co/.../resolve/main/file.safetensors with extra path segments), a ModelScope or GitHub URL, or a plain http(s) URL with a path depth != 2.","commonSituations":"Users pasting Civitai or direct-download links into the model install dialog; code that previously supported multiple source types after the source support was reduced to HuggingFace; using HF blob/file URLs whose path depth exceeds the org/repo regex.","solutions":["Use a HuggingFace repo URL of the form https://huggingface.co/<org>/<repo> (no extra path segments).","For direct files, install via the local file path instead of a URL.","Convert HF file/blob page URLs to repo-root URLs before passing them.","For non-HF sources, download the model manually and scan it into InvokeAI from disk."],"exampleFix":"// before\nawait invokeai.models.install({ source: 'https://civitai.com/models/12345' });\n// after\nawait invokeai.models.install({ source: 'https://huggingface.co/black-forest-labs/FLUX.1-schnell' });","handlingStrategy":"validation","validationCode":"import re\ndef is_hf_repo_url(url: str) -> bool:\n    return bool(re.match(r\"^https?://huggingface\\.co/[^/]+/[^/]+$\", url.lower()))\nif not is_hf_repo_url(source):\n    raise ValueError(f\"Only HF repo URLs like https://huggingface.co/org/repo are supported, got: {source}\")","typeGuard":"def is_supported_source(url: str) -> bool:\n    return isinstance(url, str) and re.match(r\"^https?://huggingface.co/[^/]+/[^/]+$\", url.lower()) is not None","tryCatchPattern":null,"preventionTips":["Only pass HF org/repo URLs to the installer","For other sources download files manually and import from a local path","Beware HF URLs with /blob/ or /resolve/ path segments — strip to org/repo"],"tags":["model-install","huggingface","url-validation","value-error"],"backgroundTag":"unsupported-source-url","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}