{"record":{"id":"ea6a2c96f8ccdf6c","repo":"Comfy-Org/ComfyUI","slug":"unrecognized-interpolation-method-method","errorCode":null,"errorMessage":"Unrecognized interpolation method '{method}'.","messagePattern":"Unrecognized interpolation method '(.+?)'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/hooks.py","lineNumber":563,"sourceCode":"\n    _LIST = [LINEAR, EASE_IN, EASE_OUT, EASE_IN_OUT]\n\n    @classmethod\n    def get_weights(cls, num_from: float, num_to: float, length: int, method: str, reverse=False):\n        diff = num_to - num_from\n        if method == cls.LINEAR:\n            weights = torch.linspace(num_from, num_to, length)\n        elif method == cls.EASE_IN:\n            index = torch.linspace(0, 1, length)\n            weights = diff * np.power(index, 2) + num_from\n        elif method == cls.EASE_OUT:\n            index = torch.linspace(0, 1, length)\n            weights = diff * (1 - np.power(1 - index, 2)) + num_from\n        elif method == cls.EASE_IN_OUT:\n            index = torch.linspace(0, 1, length)\n            weights = diff * ((1 - np.cos(index * np.pi)) / 2) + num_from\n        else:\n            raise ValueError(f\"Unrecognized interpolation method '{method}'.\")\n        if reverse:\n            weights = weights.flip(dims=(0,))\n        return weights\n\ndef get_sorted_list_via_attr(objects: list, attr: str) -> list:\n    if not objects:\n        return objects\n    elif len(objects) <= 1:\n        return [x for x in objects]\n    # now that we know we have to sort, do it following these rules:\n    # a) if objects have same value of attribute, maintain their relative order\n    # b) perform sorting of the groups of objects with same attributes\n    unique_attrs = {}\n    for o in objects:\n        val_attr = getattr(o, attr)\n        attr_list: list = unique_attrs.get(val_attr, list())\n        attr_list.append(o)\n        if val_attr not in unique_attrs:","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/hooks.py#L545-L581","documentation":"Raised by the hook keyframe interpolation helper when the interpolation method string does not match any of the four supported constants: linear, ease-in, ease-out, ease-in-out. The comparison is exact against class constants, so any other spelling (including case or separator differences) lands in the final else.","triggerScenarios":"Calling CreateHookKeyframesInterpolation (or ScheduleConditions) with strength_interpolation='sine', 'Ease In', 'ease_in', or any unsupported name. The check is `method == cls.LINEAR` etc., so exact string equality applies.","commonSituations":"Hand-typing the interpolation name in a combo or API prompt JSON; API callers forwarding arbitrary strings; locale/typo issues like 'easein' or trailing whitespace from generated workflow JSON.","solutions":["Use one of the exact supported values: 'linear', 'ease-in', 'ease-out', 'ease-in-out'","If building prompts programmatically, validate against that allowlist before submitting","Check for stray whitespace/case in the serialized workflow JSON"],"exampleFix":"# before\nhooks.CreateHookKeyframesInterpolation(..., strength_interpolation='ease_in')\n# after\nhooks.CreateHookKeyframesInterpolation(..., strength_interpolation='ease-in')","handlingStrategy":"validation","validationCode":"VALID = {'linear', 'ease-in', 'ease-out', 'ease-in-out'}\nmethod = method.strip().lower()\nassert method in VALID, f'interpolation must be one of {sorted(VALID)}'","typeGuard":"def is_valid_interpolation(method: str) -> bool:\n    return method in {'linear', 'ease-in', 'ease-out', 'ease-in-out'}","tryCatchPattern":null,"preventionTips":["Use combo widgets sourced from the constant list, not free text","Normalize (strip/lower) interpolation strings from external JSON before use"],"tags":["hooks","keyframes","interpolation","validation","string-validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}