diff --git a/src/diffusers/configuration_utils.py b/src/diffusers/configuration_utils.py index 3a01fe35..f5e5d36f 100644 --- a/src/diffusers/configuration_utils.py +++ b/src/diffusers/configuration_utils.py @@ -289,11 +289,20 @@ class ConfigMixin: # use value from config dict init_dict[key] = config_dict.pop(key) - unused_kwargs = config_dict.update(kwargs) + config_dict = {k: v for k, v in config_dict.items() if not k.startswith("_")} + + if len(config_dict) > 0: + logger.warning( + f"The config attributes {config_dict} were passed to {cls.__name__}, " + "but are not expected and will be ignored. Please verify your " + f"{cls.config_name} configuration file." + ) + + unused_kwargs = {**config_dict, **kwargs} passed_keys = set(init_dict.keys()) if len(expected_keys - passed_keys) > 0: - logger.warning( + logger.info( f"{expected_keys - passed_keys} was not found in config. Values will be initialized to default values." )