Skip to content

Commit 1a903d8

Browse files
committed
[LoRA] fix: animate diff lora stuff. (#8995)
* fix: animate diff lora stuff. * fix scaling function for UNetMotionModel * emoty
1 parent c745230 commit 1a903d8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/diffusers/loaders/peft.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
_SET_ADAPTER_SCALE_FN_MAPPING = {
3232
"UNet2DConditionModel": _maybe_expand_lora_scales,
33+
"UNetMotionModel": _maybe_expand_lora_scales,
3334
"SD3Transformer2DModel": lambda model_cls, weights: weights,
3435
}
3536

src/diffusers/models/unets/unet_motion_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import torch.utils.checkpoint
2020

2121
from ...configuration_utils import ConfigMixin, FrozenDict, register_to_config
22-
from ...loaders import FromOriginalModelMixin, UNet2DConditionLoadersMixin
22+
from ...loaders import FromOriginalModelMixin, PeftAdapterMixin, UNet2DConditionLoadersMixin
2323
from ...utils import logging
2424
from ..attention_processor import (
2525
ADDED_KV_ATTENTION_PROCESSORS,
@@ -231,7 +231,7 @@ def forward(self, sample):
231231
pass
232232

233233

234-
class UNetMotionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin):
234+
class UNetMotionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin, PeftAdapterMixin):
235235
r"""
236236
A modified conditional 2D UNet model that takes a noisy sample, conditional state, and a timestep and returns a
237237
sample shaped output.

0 commit comments

Comments
 (0)