Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/diffusers/loaders/single_file_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
mapping_functions = SINGLE_FILE_LOADABLE_CLASSES[mapping_class_name]

checkpoint_mapping_fn = mapping_functions["checkpoint_mapping_fn"]
if original_config:
if original_config is not None:
if "config_mapping_fn" in mapping_functions:
config_mapping_fn = mapping_functions["config_mapping_fn"]
else:
Expand All @@ -243,7 +243,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
original_config=original_config, checkpoint=checkpoint, **config_mapping_kwargs
)
else:
if config:
if config is not None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch should only be entered when no config is provided. If, for example, I were to pass {}, I want the model to be initialized with default parameters, but currently this does not seem possible.

if isinstance(config, str):
default_pretrained_model_config_name = config
else:
Expand All @@ -270,6 +270,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
subfolder=subfolder,
local_files_only=local_files_only,
token=token,
revision=revision,
)
expected_kwargs, optional_kwargs = cls._get_signature_keys(cls)

Expand Down
Loading