{"record":{"id":"dca7ef91463ab761","repo":"Comfy-Org/ComfyUI","slug":"schedule-schedule-unknown","errorCode":null,"errorMessage":"schedule '{schedule}' unknown.","messagePattern":"schedule '(.+?)' unknown\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/modules/diffusionmodules/util.py","lineNumber":117,"sourceCode":"        alphas = timesteps / (1 + cosine_s) * np.pi / 2\n        alphas = torch.cos(alphas).pow(2)\n        alphas = alphas / alphas[0]\n        betas = 1 - alphas[1:] / alphas[:-1]\n        betas = torch.clamp(betas, min=0, max=0.999)\n\n    elif schedule == \"squaredcos_cap_v2\":  # used for karlo prior\n        # return early\n        return betas_for_alpha_bar(\n            n_timestep,\n            lambda t: math.cos((t + 0.008) / 1.008 * math.pi / 2) ** 2,\n        )\n\n    elif schedule == \"sqrt_linear\":\n        betas = torch.linspace(linear_start, linear_end, n_timestep, dtype=torch.float64)\n    elif schedule == \"sqrt\":\n        betas = torch.linspace(linear_start, linear_end, n_timestep, dtype=torch.float64) ** 0.5\n    else:\n        raise ValueError(f\"schedule '{schedule}' unknown.\")\n    return betas\n\n\ndef make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_timesteps, verbose=True):\n    if ddim_discr_method == 'uniform':\n        c = num_ddpm_timesteps // num_ddim_timesteps\n        ddim_timesteps = np.asarray(list(range(0, num_ddpm_timesteps, c)))\n    elif ddim_discr_method == 'quad':\n        ddim_timesteps = ((np.linspace(0, np.sqrt(num_ddpm_timesteps * .8), num_ddim_timesteps)) ** 2).astype(int)\n    else:\n        raise NotImplementedError(f'There is no ddim discretization method called \"{ddim_discr_method}\"')\n\n    # assert ddim_timesteps.shape[0] == num_ddim_timesteps\n    # add one to get the final alpha values right (the ones from first scale to data during sampling)\n    steps_out = ddim_timesteps + 1\n    if verbose:\n        logging.info(f'Selected timesteps for ddim sampler: {steps_out}')\n    return steps_out","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/modules/diffusionmodules/util.py#L99-L135","documentation":"Raised by make_beta_schedule when the schedule name doesn't match any implemented beta schedule: 'linear', 'cosine', 'squaredcos_cap_v2', 'sqrt_linear', 'sqrt' (plus their quad variants). The function dispatches purely on the lowercase schedule string from the model/sampler config; unknown strings hit the trailing ValueError.","triggerScenarios":"Calling make_beta_schedule('linear-beta') or passing a config's schedule field verbatim when it contains a name this implementation doesn't have (e.g. 'sigmoid' or a typo).","commonSituations":"Porting diffusion configs between codebases (compvis/diffusers/custom) with differing schedule naming; typos in hand-written sampler configs; renamed schedules across versions.","solutions":["Use one of the supported names: 'linear', 'quad', 'cosine', 'sqrt_linear', 'sqrt', 'squaredcos_cap_v2' (and their variants as implemented)","Read the schedule string from the checkpoint config and map it to the closest supported schedule rather than inventing one","Normalize the string (lowercase, strip) before dispatch"],"exampleFix":"# before\nbetas = make_beta_schedule('cosine-beta', 1000)\n# after\nbetas = make_beta_schedule('cosine', 1000)","handlingStrategy":"validation","validationCode":"SUPPORTED = {'linear', 'quad', 'cosine', 'cosine_linear', 'squaredcos_cap_v2', 'sqrt_linear', 'sqrt'}\nif schedule not in SUPPORTED:\n    raise ValueError(f\"unsupported schedule {schedule!r}; supported: {sorted(SUPPORTED)}\")\nbetas = make_beta_schedule(schedule, n_timestep)","typeGuard":"def is_supported_schedule(name: str) -> bool:\n    return name in {'linear', 'quad', 'cosine', 'cosine_linear', 'squaredcos_cap_v2', 'sqrt_linear', 'sqrt'}","tryCatchPattern":null,"preventionTips":["Map schedule names from external configs to this implementation's names at the adapter boundary","Lowercase and strip schedule strings before dispatch"],"tags":["scheduler","diffusion","config","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}