Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/diffusers/hooks/pyramid_attention_broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def new_forward(self, module: torch.nn.Module, *args, **kwargs) -> Any:
)
should_compute_attention = (
self.state.cache is None
or self.state.iteration == 0
or not is_within_timestep_range
or self.state.iteration % self.block_skip_range == 0
)
Expand All @@ -169,7 +168,7 @@ def new_forward(self, module: torch.nn.Module, *args, **kwargs) -> Any:
else:
output = self.state.cache

self.state.cache = output
self.state.cache = output if is_within_timestep_range else None
self.state.iteration += 1
return output

Expand Down
Loading