{"record":{"id":"a68034fdfed38f58","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"unknown-checkpoint-x","errorCode":null,"errorMessage":"Unknown checkpoint: {x}","messagePattern":"Unknown checkpoint: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"scripts/xyz_grid.py","lineNumber":79,"sourceCode":"\r\n    # Rebuild the prompt with the tokens in the order we want\r\n    prompt_tmp = \"\"\r\n    for idx, part in enumerate(prompt_parts):\r\n        prompt_tmp += part\r\n        prompt_tmp += x[idx]\r\n    p.prompt = prompt_tmp + p.prompt\r\n\r\n\r\ndef confirm_samplers(p, xs):\r\n    for x in xs:\r\n        if x.lower() not in sd_samplers.samplers_map:\r\n            raise RuntimeError(f\"Unknown sampler: {x}\")\r\n\r\n\r\ndef apply_checkpoint(p, x, xs):\r\n    info = modules.sd_models.get_closet_checkpoint_match(x)\r\n    if info is None:\r\n        raise RuntimeError(f\"Unknown checkpoint: {x}\")\r\n    p.override_settings['sd_model_checkpoint'] = info.name\r\n\r\n\r\ndef confirm_checkpoints(p, xs):\r\n    for x in xs:\r\n        if modules.sd_models.get_closet_checkpoint_match(x) is None:\r\n            raise RuntimeError(f\"Unknown checkpoint: {x}\")\r\n\r\n\r\ndef confirm_checkpoints_or_none(p, xs):\r\n    for x in xs:\r\n        if x in (None, \"\", \"None\", \"none\"):\r\n            continue\r\n\r\n        if modules.sd_models.get_closet_checkpoint_match(x) is None:\r\n            raise RuntimeError(f\"Unknown checkpoint: {x}\")\r\n\r\n\r","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/scripts/xyz_grid.py#L61-L97","documentation":"The checkpoint axis handler apply_checkpoint resolves each value through modules.sd_models.get_closet_checkpoint_match, which fuzzy-matches against checkpoints known to the model list (by filename, hash, or title). A None result means no installed/loaded checkpoint matches, so it raises RuntimeError naming the unmatched value.","triggerScenarios":"Using the 'Checkpoint' axis type with a value that matches no entry in the webui's checkpoint list: a misspelled filename, a hash for a model not present in any model path, or a model that was moved/deleted on disk without refreshing the checkpoint list.","commonSituations":"Models directory changed or models on an unmounted drive; models shared via symlink with stale model list cache; API calls hardcoding checkpoint filenames from another machine; version updates that changed matching behavior or the model list was never refreshed after adding files.","solutions":["Verify the file exists under a configured models/Stable-diffusion path and press the refresh button (or restart) so the checkpoint list is rebuilt.","Use the exact checkpoint filename shown in the UI dropdown, including the .safetensors/.ckpt extension.","A substring or hash also works: pass a distinctive filename fragment or the model's sha256 short hash.","For API callers, GET /sdapi/v1/sd-models first and validate axis values against the returned model names."],"exampleFix":"# before\naxis_values = \"v1-5-pruned.ckpt, sd_xl_base.safetensors\"  # sd_xl_base not installed -> RuntimeError\n\n# after\naxis_values = \"v1-5-pruned.ckpt, dreamshaper_8.safetensors\"  # both files present in models dir","handlingStrategy":"validation","validationCode":"import modules.sd_models as sd_models\n\ndef validate_checkpoint_axis(xs: list[str]) -> None:\n    for x in xs:\n        if sd_models.get_closet_checkpoint_match(x) is None:\n            available = [c.title for c in sd_models.checkpoints_list.values()]\n            raise ValueError(f\"Checkpoint '{x}' not found. Available: {available}\")","typeGuard":"def checkpoint_exists(name: str) -> bool:\n    \"\"\"True when name resolves to an installed checkpoint (filename, substring, or hash).\"\"\"\n    return isinstance(name, str) and sd_models.get_closet_checkpoint_match(name) is not None","tryCatchPattern":"try:\n    apply_checkpoint(p, x, xs)\nexcept RuntimeError as e:\n    if \"Unknown checkpoint\" in str(e):\n        keep_default_checkpoint(p)  # fallback: continue with currently selected model\n    else:\n        raise","preventionTips":["Validate checkpoint names against /sdapi/v1/sd-models (or checkpoints_list) before batch runs.","After moving or deleting model files, refresh the checkpoint list before running grids.","Prefer exact filenames or short hashes over ambiguous substrings to avoid silent mis-matches."],"tags":["stable-diffusion-webui","xyz-grid","checkpoint","model-loading","validation"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}