Comfy-Org/ComfyUI · error · ValueError
Unrecognized interpolation method '{method}'.
Error message
Unrecognized interpolation method '{method}'. What it means
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.
Source
Thrown at comfy/hooks.py:563
_LIST = [LINEAR, EASE_IN, EASE_OUT, EASE_IN_OUT]
@classmethod
def get_weights(cls, num_from: float, num_to: float, length: int, method: str, reverse=False):
diff = num_to - num_from
if method == cls.LINEAR:
weights = torch.linspace(num_from, num_to, length)
elif method == cls.EASE_IN:
index = torch.linspace(0, 1, length)
weights = diff * np.power(index, 2) + num_from
elif method == cls.EASE_OUT:
index = torch.linspace(0, 1, length)
weights = diff * (1 - np.power(1 - index, 2)) + num_from
elif method == cls.EASE_IN_OUT:
index = torch.linspace(0, 1, length)
weights = diff * ((1 - np.cos(index * np.pi)) / 2) + num_from
else:
raise ValueError(f"Unrecognized interpolation method '{method}'.")
if reverse:
weights = weights.flip(dims=(0,))
return weights
def get_sorted_list_via_attr(objects: list, attr: str) -> list:
if not objects:
return objects
elif len(objects) <= 1:
return [x for x in objects]
# now that we know we have to sort, do it following these rules:
# a) if objects have same value of attribute, maintain their relative order
# b) perform sorting of the groups of objects with same attributes
unique_attrs = {}
for o in objects:
val_attr = getattr(o, attr)
attr_list: list = unique_attrs.get(val_attr, list())
attr_list.append(o)
if val_attr not in unique_attrs:View on GitHub (pinned to 1c6d8d45b3)
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
Example fix
# before hooks.CreateHookKeyframesInterpolation(..., strength_interpolation='ease_in') # after hooks.CreateHookKeyframesInterpolation(..., strength_interpolation='ease-in')
Defensive patterns
Strategy: validation
Validate before calling
VALID = {'linear', 'ease-in', 'ease-out', 'ease-in-out'}
method = method.strip().lower()
assert method in VALID, f'interpolation must be one of {sorted(VALID)}' Type guard
def is_valid_interpolation(method: str) -> bool:
return method in {'linear', 'ease-in', 'ease-out', 'ease-in-out'} Prevention
- Use combo widgets sourced from the constant list, not free text
- Normalize (strip/lower) interpolation strings from external JSON before use
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Need at least {require_count} hooks to combine, but only had
- Keyframe times must be finite numbers in seconds; got '{valu
- Aleph2 supports at most 5 keyframes.
- floats_strength must be either an iterable input or a float,
- INVALID_TAG_FILTER
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/ea6a2c96f8ccdf6c.
Report an issue: GitHub.