{"record":{"id":"e8c90a815f8ab280","repo":"unslothai/unsloth","slug":"local-base-repo-is-not-a-diffusers-pipeline-direct","errorCode":null,"errorMessage":"Local base_repo is not a diffusers pipeline directory (no {indexes}): {base}","messagePattern":"Local base_repo is not a diffusers pipeline directory \\(no (.+?)\\): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/diffusion.py","lineNumber":593,"sourceCode":"    pipeline (MiniMax-H3 ships no ``model_index.json`` at all), and the local-model scanners\n    already count either index. Off by default -- a conventional ``DiffusionPipeline`` load still\n    needs the conventional index, and accepting a modular directory there would only move the\n    failure back into the loader.\"\"\"\n    base = (base_repo or \"\").strip()\n    if not base:\n        return\n    try:\n        root = Path(base).expanduser()\n        exists = root.exists()\n    except OSError:\n        return  # invalid path characters -> a remote id, not a local path\n    if not exists:\n        return\n    indexes = [\"model_index.json\"]\n    if allow_modular:\n        indexes.append(\"modular_model_index.json\")\n    if not root.is_dir() or not any((root / name).is_file() for name in indexes):\n        raise ValueError(\n            f\"Local base_repo is not a diffusers pipeline directory \"\n            f\"(no {' or '.join(indexes)}): {base}\"\n        )\n\n\ndef _repo_access_message(repo: str, *, gated: bool) -> str:\n    \"\"\"The repo id AND its licence page: the worker's 401/403 names neither, and the base comes from a\n    card tag, so the user never saw which repo it is.\"\"\"\n    url = f\"https://huggingface.co/{repo}\"\n    if gated:\n        return (\n            f\"'{repo}' is gated on Hugging Face and this model cannot be downloaded without it. \"\n            f\"Accept its licence at {url}, then add a Hugging Face token that has access in \"\n            \"Studio settings and try again.\"\n        )\n    return (\n        f\"'{repo}' could not be read from Hugging Face (private, renamed or removed) and this \"\n        f\"model cannot be downloaded without it. Check {url}, then add a Hugging Face token that \"","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/diffusion.py#L575-L611","documentation":"Raised by the local-path validation for diffusion base repos: the path exists on disk and is a directory (or a non-directory path) but contains neither model_index.json nor, when allow_modular, modular_model_index.json — so it is not a diffusers pipeline directory and cannot serve as base_repo.","triggerScenarios":"Pointing base_repo at a checkpoint folder holding only .safetensors + a config.yaml (SingleFile layout), a LoRA directory, a GGUF folder, or a hub cache blob directory; a typo'd subfolder inside a real pipeline dir; an empty/failed download directory.","commonSituations":"Mixing up A1111/ComfyUI-style checkpoint layouts with diffusers layouts; moving/renaming pipeline folders so model_index.json ends up outside; interrupted downloads leaving a directory with only partial files.","solutions":["Point base_repo at the directory that directly contains model_index.json (the true pipeline root)","If the weights are a single .safetensors/.gguf checkpoint, pass it as single-file input instead of a pipeline base_repo","Re-download or complete the pipeline so model_index.json and component subfolders are present","Check for a nested wrapper directory (downloads often add one level)"],"exampleFix":"# before\n{\"base_repo\": \"/models/stable-diffusion/checkpoints\"}\n\n# after\n{\"base_repo\": \"/models/stable-diffusion/pipeline\"}  # dir containing model_index.json","handlingStrategy":"validation","validationCode":"from pathlib import Path\ndef is_diffusers_pipeline_dir(base: str, allow_modular: bool = False) -> bool:\n    root = Path(base).expanduser()\n    if not root.is_dir():\n        return False\n    names = [\"model_index.json\"] + ([\"modular_model_index.json\"] if allow_modular else [])\n    return any((root / n).is_file() for n in names)","typeGuard":null,"tryCatchPattern":"try:\n    validate_local_base(base, allow_modular=True)\nexcept ValueError as e:\n    if \"not a diffusers pipeline directory\" in str(e):\n        hint = \"point base_repo at the folder containing model_index.json\"","preventionTips":["Check for model_index.json at the exact path before passing base_repo","Use the single-file path for raw .safetensors checkpoints","Watch for extra wrapper directories created by downloads"],"tags":["diffusion","diffusers","filesystem","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}