Skip to content

Commit 496169c

Browse files
committed
Fix scalar register_modules skipping config key for optional components
When a scalar value is mis-passed to register_modules (e.g. bool from legacy positional super().__init__), record (None, None) in config like the None branch instead of skipping register_to_config entirely. This keeps config keys aligned with __init__ signature so .components and enable_model_cpu_offload do not raise ValueError after init succeeds.
1 parent 69ee02e commit 496169c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def register_modules(self, **kwargs):
215215
elif isinstance(module, (bool, int, float, str)):
216216
# Scalar values (e.g. bool mis-passed as image_encoder from legacy super().__init__) are not
217217
# model components — skip library tuple registration. See https://github.com/huggingface/diffusers/issues/6969
218-
register_dict = {}
218+
register_dict = {name: (None, None)}
219219
else:
220220
library, class_name = _fetch_class_library_tuple(module)
221221
register_dict = {name: (library, class_name)}

0 commit comments

Comments
 (0)