diff --git a/ae_animation_core.py b/ae_animation_core.py index de187f1..9b99750 100644 --- a/ae_animation_core.py +++ b/ae_animation_core.py @@ -285,9 +285,21 @@ class AERender(io.ComfyNode): def _get_value(cls, keyframes: Dict[str, Any], prop: str, time: float, default: float) -> float: if prop not in keyframes: return default - frames = sorted(keyframes[prop], key=lambda k: k.get("time", 0)) + + frames_data = keyframes[prop] + if not isinstance(frames_data, list): + return default + + # Filter valid frames that have both 'time' and 'value' + frames = [] + for frame in frames_data: + if isinstance(frame, dict) and 'time' in frame and 'value' in frame: + frames.append(frame) + if not frames: return default + + frames = sorted(frames, key=lambda k: k.get("time", 0)) if time <= frames[0]["time"]: return frames[0]["value"] if time >= frames[-1]["time"]: @@ -535,4 +547,4 @@ class AEAnimationExtension(ComfyExtension): async def comfy_entrypoint() -> AEAnimationExtension: - return AEAnimationExtension() \ No newline at end of file + return AEAnimationExtension()