{"record":{"id":"8514f7df173ed959","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"unknown-sampler-x","errorCode":null,"errorMessage":"Unknown sampler: {x}","messagePattern":"Unknown sampler: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"scripts/xyz_grid.py","lineNumber":73,"sourceCode":"\r\n    # Split the prompt up, taking out the tokens\r\n    for _, token in token_order:\r\n        n = p.prompt.find(token)\r\n        prompt_parts.append(p.prompt[0:n])\r\n        p.prompt = p.prompt[n + len(token):]\r\n\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","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/scripts/xyz_grid.py#L55-L91","documentation":"The sampler-axis validation function confirm_samplers runs before the grid is generated and checks every requested sampler name (lowercased) against the sd_samplers.samplers_map registry. If a name is not a registered sampler, generation cannot proceed, so it raises RuntimeError listing the offending value.","triggerScenarios":"Setting the X/Y/Z axis type to 'Sampler' with a list containing an unknown or misspelled sampler name (e.g. 'Euler a ' with trailing space, 'dpm++ 2M' in wrong casing/format, or a sampler removed/renamed in a newer webui version). Also triggered when a checkpoint or extension registers custom samplers that are not loaded.","commonSituations":"Version drift: sampler names changed between webui releases (k_* aliases vs display names); tutorials referencing samplers that no longer exist; trailing whitespace or smart quotes from copy-pasting lists; API callers passing sampler IDs from a different backend (e.g. ComfyUI names).","solutions":["Use exact names from the webui's sampler dropdown (e.g. 'Euler a', 'DPM++ 2M Karras', 'DDIM'); copy them from the UI rather than typing.","Trim whitespace and normalize casing in the axis value list before running.","Print available names at runtime: `from modules import sd_samplers; print(sd_samplers.samplers_map.keys())` and match your list against it.","If a sampler is genuinely missing, update the webui or the extension that provides it."],"exampleFix":"# before\naxis_values = \"Euler ancestral, DPM2\"  # unknown names -> RuntimeError\n\n# after\naxis_values = \"Euler a, DPM++ 2S a\"  # exact registered names","handlingStrategy":"validation","validationCode":"from modules import sd_samplers\n\ndef validate_sampler_axis(xs: list[str]) -> list[str]:\n    unknown = [x for x in xs if x.strip().lower() not in sd_samplers.samplers_map]\n    if unknown:\n        raise ValueError(f\"Unknown samplers: {unknown}; available: {sorted(sd_samplers.samplers_map)}\")\n    return [x.strip() for x in xs]","typeGuard":"def is_known_sampler(name: str) -> bool:\n    \"\"\"True when name (case-insensitive, trimmed) is a registered sampler.\"\"\"\n    return isinstance(name, str) and name.strip().lower() in sd_samplers.samplers_map","tryCatchPattern":"try:\n    confirm_samplers(p, xs)\nexcept RuntimeError as e:\n    match = re.search(r\"Unknown sampler: (.+)\", str(e))\n    if match:\n        xs = [x for x in xs if x.lower() in sd_samplers.samplers_map]  # drop bad entries\n    else:\n        raise","preventionTips":["Source sampler names from sd_samplers.samplers_map programmatically instead of hardcoding.","Strip and lowercase-verify pasted lists before running.","After upgrading the webui, re-validate saved presets that reference sampler names."],"tags":["stable-diffusion-webui","xyz-grid","sampler","validation","configuration"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}