Attempt to fix hooks being disabled at first step of second sampler

Still invokes the ModelPatcher when it shouldn't need to.
Causes very slight difference in results, but not nearly as much.
This commit is contained in:
catboxanon 2024-12-23 12:45:56 -05:00
parent f18ebbd316
commit 711d5b09c6

View File

@ -432,8 +432,12 @@ class HookKeyframeGroup:
return False
prev_index = self._current_index
prev_strength = self._current_strength
# if met guaranteed steps, look for next keyframe in case need to switch
if self._current_used_steps >= self._current_keyframe.guarantee_steps:
if (
# if met guaranteed steps, look for next keyframe in case need to switch
self._current_used_steps >= self._current_keyframe.guarantee_steps
# handle case where guarantee_steps is 1 at first keyframe, but later steps have already occurred
or bool(self._current_keyframe == self.keyframes[0] and self.keyframes[1].start_t >= curr_t)
):
# if has next index, loop through and see if need to switch
if self.has_index(self._current_index+1):
for i in range(self._current_index+1, len(self.keyframes)):