Skip to content

Commit c104482

Browse files
DN6yiyixuxu
andauthored
Fix warning in UNetMotionModel (#8756)
* update * Update src/diffusers/models/unets/unet_motion_model.py Co-authored-by: YiYi Xu <[email protected]> --------- Co-authored-by: YiYi Xu <[email protected]>
1 parent c7a84ba commit c104482

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/diffusers/models/unets/unet_motion_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,9 @@ def from_unet2d(
597597
if not config.get("num_attention_heads"):
598598
config["num_attention_heads"] = config["attention_head_dim"]
599599

600-
config = FrozenDict(config)
600+
expected_kwargs, optional_kwargs = cls._get_signature_keys(cls)
601+
config = FrozenDict({k: config.get(k) for k in config if k in expected_kwargs or k in optional_kwargs})
602+
config["_class_name"] = cls.__name__
601603
model = cls.from_config(config)
602604

603605
if not load_weights:

0 commit comments

Comments
 (0)