AUTOMATIC1111/stable-diffusion-webui · error · ValueError

Unable to find model info: {path}

Error message

Unable to find model info: {path}

What it means

ValueError raised by DatUpscaler.load_model when the requested path does not match any UpscalerData.data_path among the registered DAT scalers. The loop matches scaler.data_path == path exactly; if the caller (upscaler dispatch by name or user code calling load_model directly) passes a local filename, a title like 'DAT x2', or a URL variant (http vs https, trailing slash), no scaler matches and this generic 'Unable to find model info' is raised.

Source

Thrown at modules/dat_model.py:56

        return upscale_with_model(
            model_descriptor,
            img,
            tile_size=opts.DAT_tile,
            tile_overlap=opts.DAT_tile_overlap,
        )

    def load_model(self, path):
        for scaler in self.scalers:
            if scaler.data_path == path:
                if scaler.local_data_path.startswith("http"):
                    scaler.local_data_path = modelloader.load_file_from_url(
                        scaler.data_path,
                        model_dir=self.model_download_path,
                    )
                if not os.path.exists(scaler.local_data_path):
                    raise FileNotFoundError(f"DAT data missing: {scaler.local_data_path}")
                return scaler
        raise ValueError(f"Unable to find model info: {path}")


def get_dat_models(scaler):
    return [
        UpscalerData(
            name="DAT x2",
            path="https://github.com/n0kovo/dat_upscaler_models/raw/main/DAT/DAT_x2.pth",
            scale=2,
            upscaler=scaler,
        ),
        UpscalerData(
            name="DAT x3",
            path="https://github.com/n0kovo/dat_upscaler_models/raw/main/DAT/DAT_x3.pth",
            scale=3,
            upscaler=scaler,
        ),
        UpscalerData(
            name="DAT x4",

View on GitHub (pinned to 82a973c043)

Solutions

  1. Pass exactly the scaler's registered path: iterate upscaler.scalers and use scaler.data_path (the https URL) as the argument
  2. Re-derive the scaler by matching user-visible name to UpscalerData.name first, then call load_model(scaler.path)
  3. Refresh the upscaler list in the UI after adding/removing DAT models

Example fix

# before
scaler = dat_upscaler.DatUpscaler()
info = scaler.load_model('models/DAT/DAT_x2.pth')  # ValueError

# after
data = next(d for d in scaler.scalers if d.name == 'DAT x2')
info = scaler.load_model(data.path)
Defensive patterns

Strategy: type-guard

Validate before calling

paths = {d.path for d in scaler.scalers}
if path not in paths:
    raise ValueError(f'unknown DAT path {path!r}; registered: {sorted(paths)}')

Type guard

def is_registered_dat_path(path: str, upscaler) -> bool:
    return any(d.path == path for d in upscaler.scalers)

Try / catch

try:
    scaler.load_model(path)
except ValueError as e:
    if 'Unable to find model info' in str(e):
        d = next((d for d in scaler.scalers if d.name in path or path in d.name), None)
        if d: return scaler.load_model(d.path)
    raise

Prevention

When it happens

Trigger: Calling upscaler.load_model('models/DAT/DAT_x2.pth') (local path) instead of the registered https URL string; UI code resolving a scaler by name then passing the name back into load_model; mismatch after the DAT entry list changed (scale added/removed) between the cached UpscalerData and the request.

Common situations: Custom scripts/extensions driving upscalers with file paths rather than the canonical UpscalerData.path; stale scaler caches listing retired DAT entries; URL scheme changes upstream.

Related errors


AI-assisted analysis of AUTOMATIC1111/stable-diffusion-webui@82a973c043 (2026-08-14). Data as JSON: /api/errors/640c72c1c22612d5. Report an issue: GitHub.