Fix the disable_free_noise function in AnimateDiffFreeNoiseMixin#13561
Open
cartesian-plane wants to merge 1 commit intohuggingface:mainfrom
Open
Fix the disable_free_noise function in AnimateDiffFreeNoiseMixin#13561cartesian-plane wants to merge 1 commit intohuggingface:mainfrom
disable_free_noise function in AnimateDiffFreeNoiseMixin#13561cartesian-plane wants to merge 1 commit intohuggingface:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the
disable_free_noisefunction inAnimateDiffFreeNoiseMixinThe
self.unet.mid_blockwas being unconditionally included as a result of the newif/elsebranch introduced in #9288.This means that
self._disable_free_noise_in_block(block)could be called for themid_block, which would attempt to access themotion_modulesproperty of themid_blockeven though it does not exist:diffusers/src/diffusers/pipelines/free_noise_utils.py
Line 192 in f7fd76a
The fix simply removes the leftover blocks assignment line.
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@a-r-r-o-w
@dhruvrnaik