"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "77241c48af6e31d9f7fabba63079ec62ac01be5a"
Unverified Commit a5967265 authored by Dhruv Nair's avatar Dhruv Nair Committed by GitHub
Browse files

Fix Freenoise for AnimateDiff V3 checkpoint. (#9288)

update
parent 9aca79f2
...@@ -220,13 +220,22 @@ class AnimateDiffFreeNoiseMixin: ...@@ -220,13 +220,22 @@ class AnimateDiffFreeNoiseMixin:
self._free_noise_weighting_scheme = weighting_scheme self._free_noise_weighting_scheme = weighting_scheme
self._free_noise_noise_type = noise_type self._free_noise_noise_type = noise_type
blocks = [*self.unet.down_blocks, self.unet.mid_block, *self.unet.up_blocks] if hasattr(self.unet.mid_block, "motion_modules"):
blocks = [*self.unet.down_blocks, self.unet.mid_block, *self.unet.up_blocks]
else:
blocks = [*self.unet.down_blocks, *self.unet.up_blocks]
for block in blocks: for block in blocks:
self._enable_free_noise_in_block(block) self._enable_free_noise_in_block(block)
def disable_free_noise(self) -> None: def disable_free_noise(self) -> None:
self._free_noise_context_length = None self._free_noise_context_length = None
if hasattr(self.unet.mid_block, "motion_modules"):
blocks = [*self.unet.down_blocks, self.unet.mid_block, *self.unet.up_blocks]
else:
blocks = [*self.unet.down_blocks, *self.unet.up_blocks]
blocks = [*self.unet.down_blocks, self.unet.mid_block, *self.unet.up_blocks] blocks = [*self.unet.down_blocks, self.unet.mid_block, *self.unet.up_blocks]
for block in blocks: for block in blocks:
self._disable_free_noise_in_block(block) self._disable_free_noise_in_block(block)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment