invoke-ai/InvokeAI · error · Exception

No files associated with {source}

Error message

No files associated with {source}

What it means

_remote_files_from_source() resolves the downloadable files for a model source (HF repo or URL). If it cannot determine any remote files for the source — no metadata, no download URLs, no usable URL fallback — it raises a generic Exception('No files associated with {source}').

Source

Thrown at invokeai/app/services/model_install/model_install_default.py:870

                    subfolders=subfolders if len(subfolders) > 1 else None,
                    session=self._session,
                ),
                metadata,
            )

        if isinstance(source, URLModelSource):
            try:
                fetcher = self.get_fetcher_from_url(str(source.url))
                kwargs: dict[str, Any] = {"session": self._session}
                metadata = fetcher(**kwargs).from_url(source.url)
                assert isinstance(metadata, ModelMetadataWithFiles)
                return metadata.download_urls(session=self._session), metadata
            except ValueError:
                pass

            return [RemoteModelFile(url=self._normalize_huggingface_blob_url(source.url), path=Path("."), size=0)], None

        raise Exception(f"No files associated with {source}")

    def _guess_source(self, source: str) -> ModelSource:
        """Turn a source string into a ModelSource object."""
        variants = "|".join(ModelRepoVariant.__members__.values())
        hf_repoid_re = f"^([^/:]+/[^/:]+)(?::({variants})?(?::/?([^:]+))?)?$"
        source_obj: Optional[StringLikeSource] = None
        source_stripped = source.strip('"')

        if source_stripped.startswith("external://"):
            external_id = source_stripped.removeprefix("external://")
            provider_id, _, provider_model_id = external_id.partition("/")
            if not provider_id or not provider_model_id:
                raise ValueError(f"Invalid external model source: '{source_stripped}'")
            source_obj = ExternalModelSource(provider_id=provider_id, provider_model_id=provider_model_id)
        elif Path(source_stripped).exists():  # A local file or directory
            source_obj = LocalModelSource(path=Path(source_stripped))
        elif match := re.match(hf_repoid_re, source):
            source_obj = HFModelSource(

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Verify the source repo/URL actually contains downloadable weight files in a browser or via the HF API.
  2. Remove/adjust variant, subfolder, or path filters on HFModelSource so files match.
  3. Re-fetch metadata — a stale/mis-serialized metadata record may have empty download_urls; clear cached metadata for the repo.
  4. Use a direct file URL (URLModelSource to the exact file) instead of a repo-level source.

Example fix

// before
service.download_and_cache_model(HFModelSource(repo_id='author/repo', variant='wrong-variant'))
// after
service.download_and_cache_model(HFModelSource(repo_id='author/repo'))  # drop filters or point at a repo with weights
Defensive patterns

Strategy: validation

Validate before calling

# verify the source has files before requesting install
import requests
r = requests.get(f'https://huggingface.co/api/models/{repo_id}', timeout=10)
has_files = bool(r.json().get('siblings'))

Type guard

def is_installable_source(source) -> bool:
    return isinstance(source, (HFModelSource, URLModelSource)) and bool(getattr(source, 'url', None) or getattr(source, 'repo_id', None))

Try / catch

try:
    files = service._remote_files_from_source(source)
except Exception:
    files = []
if not files:
    raise RuntimeError(f'Source {source} has no downloadable files; check repo/URL')

Prevention

When it happens

Trigger: Passing a HFModelSource/URLModelSource whose metadata yields an empty download_urls list; a repo with no model weights matching the variant/subfolder filters; a URL source that reaches the final fallback branch without usable metadata or url; custom ModelSource subclasses unsupported by the method.

Common situations: HuggingFace repo contains only metadata/code, no weight files; incorrect variant or subfolder filters exclude all files; deleted/renamed repo returning sparse metadata; pointing at an HTML page URL instead of a file.

Related errors


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