Skip to content

Commit 8f206a5

Browse files
yiyixuxuyiyixuxu
andauthored
fix a bug in from_config (#7192)
* fix * fix * update comment --------- Co-authored-by: yiyixuxu <yixu310@gmail,com>
1 parent 8da360a commit 8f206a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/diffusers/configuration_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ def from_config(cls, config: Union[FrozenDict, Dict[str, Any]] = None, return_un
259259
model = cls(**init_dict)
260260

261261
# make sure to also save config parameters that might be used for compatible classes
262+
# update _class_name
263+
if "_class_name" in hidden_dict:
264+
hidden_dict["_class_name"] = cls.__name__
265+
262266
model.register_to_config(**hidden_dict)
263267

264268
# add hidden kwargs of compatible classes to unused_kwargs

0 commit comments

Comments
 (0)