Skip to content

Fix the disable_free_noise function in AnimateDiffFreeNoiseMixin#13561

Open
cartesian-plane wants to merge 1 commit intohuggingface:mainfrom
cartesian-plane:fix-disable-FreeNoise-in-FreeNoise-implementation
Open

Fix the disable_free_noise function in AnimateDiffFreeNoiseMixin#13561
cartesian-plane wants to merge 1 commit intohuggingface:mainfrom
cartesian-plane:fix-disable-FreeNoise-in-FreeNoise-implementation

Conversation

@cartesian-plane
Copy link
Copy Markdown

What does this PR do?

Fixes the disable_free_noise function in AnimateDiffFreeNoiseMixin

The self.unet.mid_block was being unconditionally included as a result of the new if/else branch introduced in #9288.
This means that self._disable_free_noise_in_block(block) could be called for the mid_block, which would attempt to access the motion_modules property of the mid_block even though it does not exist:

for motion_module in block.motion_modules:

The fix simply removes the leftover blocks assignment line.

Before submitting

Who can review?

@a-r-r-o-w
@dhruvrnaik

The `self.unet.mid_block` was being unconditionally included as a result of the new
`if/else` branch introduced in huggingface#9288.
This means that `self._disable_free_noise_in_block(block)` could be called for the
`mid_block`, which would attempt to access the `motion_modules` property of the `mid_block` even though it does not exist:

```python
for motion_module in block.motion_modules:
```
https://github.com/huggingface/diffusers/blob/f7fd76adcd288494a1a13c82d06e37579170aaf3/src/diffusers/pipelines/free_noise_utils.py#L192

The fix simply removes the leftover blocks assignment line.
@github-actions github-actions Bot added pipelines size/S PR with diff < 50 LOC labels Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipelines size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant